/* Portside Hub: dashboard "Portside Apps" row (sits where the stat tiles used to be).
   The sidebar itself now lives in hub-shell.css / hub-shell.js. */

/* Three tiles across (Forms, Email, Social): they share the full row width. */
.hub-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .hub-apps { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.hub-app {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #fff; border: 1px solid #f1f5f9; border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05); padding: 7px 9px; min-width: 0;
  color: inherit; text-decoration: none; position: relative;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
/* Notification bubble on a tile: how long since the last "Mark as posted" press. */
.hub-badge {
  position: absolute; top: -8px; right: 8px; z-index: 1;
  font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .01em; white-space: nowrap;
  padding: 4px 7px; border-radius: 999px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; color: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
}
.hub-badge-ok { background: #2f7d55; }
.hub-badge-warn { background: #d99a06; color: #1b1500; }
.hub-badge-late { background: #c2362b; }
.hub-app:hover { border-color: #499292; box-shadow: 0 4px 14px rgba(17, 50, 77, .12); transform: translateY(-1px); }
.hub-app:focus-visible { outline: 2px solid #499292; outline-offset: 2px; }
.hub-app-name { font-size: 12.5px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.hub-app-desc { font-size: 10.5px; color: #94a3b8; margin-top: 1px; line-height: 1.25; }
.hub-app-icon {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(73, 146, 146, .13); color: #499292;
}
.hub-app-icon svg { width: 13px; height: 13px; }

/* ---- Dashboard: Brand Colors tile ---- */
.hub-colors-tools { display: flex; gap: 2px; }
.hub-colors-btn {
  display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px;
  background: transparent; color: #64748b; cursor: pointer; transition: background .12s, color .12s;
}
.hub-colors-btn:hover:not(:disabled) { background: #e2e8f0; color: #11324d; }
.hub-colors-btn:disabled { opacity: .4; cursor: default; }
.hub-colors-btn svg { width: 15px; height: 15px; }
.hub-colors-btn:focus-visible, .hub-color:focus-visible, .hub-colors-add:focus-visible { outline: 2px solid #499292; outline-offset: 1px; }

/* Compact swatches that regroup into as many columns as the tile is wide */
.hub-colors.hub-colors { padding: 8px 10px; }
.hub-colors-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 2px 6px; }
.hub-color {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 5px; border: 0; border-radius: 6px;
  background: transparent; text-align: left; cursor: pointer; font: inherit; transition: background .12s;
}
.hub-color:hover { background: #f1f5f9; }
.hub-swatch { width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; border: 1px solid rgba(15, 23, 42, .15); }
.hub-color-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.hub-color-name { font-size: 10.5px; font-weight: 600; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-color-hex { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9.5px; color: #64748b; }
.hub-colors-empty { margin: 0; font-size: 13px; color: #94a3b8; text-align: center; padding: 8px 0; }

.hub-colors .hub-colors-list:has(.hub-color-edit) { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 12px; }
.hub-color-edit { display: flex; align-items: center; gap: 8px; }
.hub-color-edit input[type="color"] { width: 32px; height: 32px; padding: 0; border: 1px solid #cbd5e1; border-radius: 7px; background: none; cursor: pointer; flex-shrink: 0; }
.hub-color-in { height: 32px; min-width: 0; width: 92px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 7px; font: inherit; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #0f172a; background: #fff; }
.hub-color-in.hub-color-nm { flex: 1; width: auto; font-family: inherit; }
.hub-color-in:focus { outline: 2px solid #499292; outline-offset: -1px; border-color: transparent; }
.hub-color-in.is-bad { border-color: #dc2626; }
.hub-colors-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 10px; border: 1px dashed #94a3b8; border-radius: 7px; background: none; color: #475569; font: inherit; font-size: 12.5px; cursor: pointer; }
.hub-colors-add:hover { border-color: #499292; color: #2f7984; }
.hub-colors-add svg { width: 14px; height: 14px; }
.hub-colors-err { margin: 8px 0 0; font-size: 12px; color: #dc2626; }

/* ---- Hub dialogs, drawers and settings (project details, client drawer, CRM settings) ----
   Palette: navy #11324d, gold #d3c30c, cream #f5f6e8, teal #499292 / #2f7984, page gray #ededed. */
.hx-dialog.hx-dialog, .hx-drawer.hx-drawer { padding: 0; gap: 0; display: flex; flex-direction: column; background: #fff; border: 0; font-family: Raleway, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #11324d; }
.hx-dialog.hx-dialog { max-width: 720px; width: calc(100% - 24px); max-height: 90vh; border-radius: 16px; overflow: hidden; border-top: 4px solid #d3c30c; box-shadow: 0 24px 60px rgba(17, 50, 77, .3); }
.hx-drawer.hx-drawer { max-width: 480px; width: 100%; border-left: 4px solid #d3c30c; overflow: hidden; box-shadow: -12px 0 40px rgba(17, 50, 77, .25); }
.hx-head { padding: 20px 52px 14px 22px; background: #f5f6e8; border-bottom: 1px solid #e6e8d2; flex-shrink: 0; text-align: left; }
.hx-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #2f7984; }
.hx-title.hx-title { margin: 4px 0 0; font-family: Merriweather, Georgia, serif; font-size: 21px; font-weight: 700; line-height: 1.25; color: #11324d; letter-spacing: 0; }
.hx-meta-line { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: #475569; }
.hx-meta-line a { color: #2f7984; text-decoration: none; font-weight: 600; }
.hx-meta-line a:hover { text-decoration: underline; }
.hx-headrow { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hx-body { padding: 16px 22px 22px; overflow-y: auto; flex: 1; min-height: 0; text-align: left; }
.hx-btn, .hx-btn-primary { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.3; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.hx-btn { border: 1px solid #11324d; background: #fff; color: #11324d; margin-left: auto; }
.hx-btn:hover { background: #11324d; color: #f5f6e8; }
.hx-btn-primary.hx-btn-primary { border: 1px solid #11324d; background: #11324d; color: #f5f6e8; height: auto; }
.hx-btn-primary.hx-btn-primary:hover { background: #0b2236; }
.hx-btn-primary:disabled { opacity: .45; cursor: default; }
.hx-btn:focus-visible, .hx-btn-primary:focus-visible, .hx-tab:focus-visible, .hx-iconbtn:focus-visible { outline: 2px solid #499292; outline-offset: 2px; }
.hx-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: #ededed; color: #11324d; }
.hx-chip.hx-bad { background: #fee4e2; color: #b42318; }
.hx-chip.hx-warn { background: #fdf3c4; color: #7a5b00; }
.hx-chip.hx-teal { background: rgba(73, 146, 146, .16); color: #2f7984; }
.hx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.hx-fact { background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 9px 12px; }
.hx-fact.is-wide { grid-column: 1 / -1; }
.hx-fact-l { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.hx-fact-v { margin-top: 2px; font-size: 14px; font-weight: 600; color: #11324d; }
.hx-switchrow { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f5f6e8; border: 1px solid #e6dc6a; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.hx-tabs { display: flex; gap: 2px; margin: 16px 0 14px; border-bottom: 1px solid #e5e7eb; }
.hx-drawer .hx-tabs { margin: 0; padding: 0 22px; flex-shrink: 0; background: #fff; }
.hx-tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer; }
.hx-tab:hover { color: #11324d; }
.hx-tab.is-on { color: #11324d; border-bottom-color: #499292; }
.hx-count { margin-left: 6px; min-width: 20px; display: inline-block; text-align: center; background: #ededed; color: #11324d; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.hx-compose { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.hx-ta { flex: 1; min-height: 44px; border: 1px solid #d1d5db; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; color: #0f172a; resize: vertical; background: #fff; }
.hx-ta:focus { outline: 2px solid #499292; outline-offset: -1px; border-color: transparent; }
.hx-note { display: flex; justify-content: space-between; gap: 10px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.hx-note-t { margin: 0 0 4px; font-size: 14px; color: #1f2937; white-space: pre-wrap; overflow-wrap: anywhere; }
.hx-meta { font-size: 12px; color: #64748b; }
.hx-iconbtn { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: #94a3b8; cursor: pointer; }
.hx-iconbtn:hover { background: #fee4e2; color: #b42318; }
.hx-timeline { list-style: none; margin: 0 0 0 6px; padding: 0; border-left: 2px solid #e5e7eb; }
.hx-tl { position: relative; padding: 0 0 14px 16px; font-size: 14px; color: #1f2937; }
.hx-tl::before { content: ''; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #499292; border: 2px solid #fff; }
.hx-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 20px 0; }
.hx-sec { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #11324d; }
.hx-sec:first-child { margin-top: 0; }
.hx-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef0f2; }
.hx-row-main { flex: 1; min-width: 0; }
.hx-row-t { font-size: 14px; font-weight: 700; color: #11324d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-row-s { margin-top: 1px; font-size: 12px; color: #64748b; }
.hx-over { color: #b42318; font-weight: 700; }
.hx-today { color: #7a5b00; font-weight: 700; }
.hx-price { font-size: 14px; color: #11324d; white-space: nowrap; }
.hx-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: #2f7984; cursor: pointer; text-transform: none; letter-spacing: 0; }
.hx-link:hover { text-decoration: underline; }
.hx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hx-notebox { margin-top: 8px; background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #1f2937; white-space: pre-wrap; }

/* CRM settings page */
.hx-page { min-height: 100vh; background: #ededed; }
.hx-wrap { max-width: 1040px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 16px; font-family: Raleway, ui-sans-serif, system-ui, sans-serif; color: #11324d; }
.hx-h1 { margin: 0; font-family: Merriweather, Georgia, serif; font-size: 26px; font-weight: 700; color: #11324d; }
.hx-lead { margin: 4px 0 0; font-size: 14px; color: #475569; }
.hx-seg { display: inline-flex; gap: 2px; padding: 3px; background: #fff; border: 1px solid #d1d5db; border-radius: 10px; align-self: flex-start; }
.hx-seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: #11324d; cursor: pointer; }
.hx-seg button.is-on { background: #11324d; color: #f5f6e8; }
.hx-seg button:focus-visible { outline: 2px solid #499292; outline-offset: 1px; }
.hx-note-strip { font-size: 13px; color: #11324d; background: #f5f6e8; border: 1px solid #e6dc6a; border-left: 4px solid #d3c30c; border-radius: 10px; padding: 8px 12px; }
.hx-note-strip a { color: #2f7984; font-weight: 700; text-decoration: underline; }
.hx-set-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .hx-set-grid { grid-template-columns: 300px minmax(0, 1fr); } }
.hx-card, .hx-card-lite { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.hx-card-lite.hx-card-lite { padding: 0; overflow: hidden; }
.hx-card-lite td, .hx-card-lite th { padding-top: 8px; padding-bottom: 8px; }
.hx-ch { padding: 10px 14px; border-bottom: 1px solid #eef0f2; gap: 8px; }
.hx-card > .hx-ch, .hx-card-lite > .hx-ch { display: flex; align-items: center; justify-content: space-between; }
.hx-ct.hx-ct { margin: 0; font-family: Merriweather, Georgia, serif; font-size: 15px; font-weight: 700; line-height: 1.3; color: #11324d; letter-spacing: 0; }
.hx-ch > div.flex { width: 100%; }
.hx-sub2 { margin: 1px 0 0; font-size: 12px; color: #64748b; }
.hx-cb.hx-cb { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.hx-stage-row.hx-stage-row { display: flex; align-items: center; gap: 10px; padding: 5px 10px; background: #fafbfc; border: 1px solid #eef0f2; border-radius: 8px; }
.hx-addrow { display: flex; gap: 6px; padding: 10px 14px 0; }
.hx-inp { flex: 1; min-width: 0; height: 34px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; background: #fff; }
.hx-inp:focus { outline: 2px solid #499292; outline-offset: -1px; border-color: transparent; }
.hx-typechips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 4px; }
.hx-type { display: inline-flex; align-items: center; border: 1px solid #d1d5db; border-radius: 999px; background: #fff; color: #11324d; font-size: 13px; font-weight: 600; overflow: hidden; }
.hx-type button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.hx-type .hx-type-n { padding: 4px 4px 4px 11px; font-weight: 600; }
.hx-type .hx-type-x { padding: 4px 9px 4px 4px; color: #94a3b8; display: grid; place-items: center; }
.hx-type .hx-type-x:hover { color: #b42318; }
.hx-type:not(.is-off) { border-color: #499292; background: rgba(73, 146, 146, .1); }
.hx-type.is-off { color: #94a3b8; text-decoration: line-through; }
.hx-type button:focus-visible { outline: 2px solid #499292; outline-offset: -2px; }
.hx-help { margin: 0; padding: 4px 14px 12px; font-size: 12px; color: #64748b; }
.hx-rules summary { cursor: pointer; list-style: none; padding: 10px 14px; font-family: Merriweather, Georgia, serif; font-size: 15px; font-weight: 700; color: #11324d; }
.hx-rules summary::-webkit-details-marker { display: none; }
.hx-rules summary::after { content: '+'; float: right; color: #2f7984; }
.hx-rules[open] summary::after { content: '\2212'; }
.hx-rules ul { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 20px; font-size: 13px; color: #334155; }
.hx-rules li b { color: #11324d; }

/* .hx-skin: Fixed assets, Amortization and Billings & revenue pages use the Hub palette instead of the old emerald/slate look */
.hx-skin { background: #ededed; font-family: Raleway, ui-sans-serif, system-ui, sans-serif; color: #11324d; }
.hx-skin .hx-lead { margin: 4px 0 0; font-size: 14px; color: #475569; }
.hx-skin h1, .hx-skin h2, .hx-skin h3 { font-family: Merriweather, Georgia, serif; color: #11324d; letter-spacing: 0; }
.hx-skin .shadow, .hx-skin .shadow-sm { box-shadow: none; }
.hx-skin [class*="rounded-xl"], .hx-skin .border.rounded-lg { border-color: #e5e7eb; }
.hx-skin .bg-emerald-600, .hx-skin button.bg-emerald-600 { background: #11324d !important; color: #f5f6e8 !important; border-color: #11324d !important; }
.hx-skin .bg-emerald-600:hover { background: #0b2236 !important; }
.hx-skin .border-emerald-600 { border-color: #11324d !important; color: #11324d !important; }
.hx-skin .border-emerald-600:hover, .hx-skin .hover\:bg-emerald-50:hover { background: #f5f6e8 !important; }
.hx-skin .text-emerald-600, .hx-skin .text-emerald-700 { color: #2f7984 !important; }
.hx-skin [data-state="on"] { background: #11324d !important; color: #f5f6e8 !important; }
.hx-skin .bg-emerald-50 { background: rgba(73, 146, 146, .12) !important; }
.hx-skin .border-emerald-200 { border-color: rgba(73, 146, 146, .35) !important; }
.hx-skin th, .hx-skin thead th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6b7280 !important; font-weight: 800; background: #fafbfc; }
.hx-skin .bg-blue-50 { background: #f5f6e8 !important; color: #11324d; }
.hx-skin .bg-slate-200 { background: #e6e8d2 !important; }
.hx-skin .bg-green-50 { background: rgba(73, 146, 146, .1) !important; }
.hx-skin .bg-blue-100.text-blue-700 { background: rgba(73, 146, 146, .16) !important; color: #2f7984 !important; }
.hx-skin .p-4.flex.flex-col.gap-2 { border-top: 4px solid #499292; }
.hx-skin .grid > .p-4.flex.flex-col.gap-2:nth-child(2) { border-top-color: #eab308; }
.hx-skin .grid > .p-4.flex.flex-col.gap-2:nth-child(3) { border-top-color: #78aa5b; }
.hx-skin .grid > .p-4.flex.flex-col.gap-2:nth-child(4) { border-top-color: #11324d; }
.hx-skin .hx-seg { margin-right: 4px; }

/* Fixed assets, amortization and billings pages: shared Hub page header and tables */
.hx-h1 { margin: 0; font-family: Merriweather, Georgia, serif; font-size: 26px; font-weight: 700; color: #11324d; }
.page-header h1 { font-family: Merriweather, Georgia, serif; color: #11324d; }
.min-h-screen.bg-slate-50 { background: #ededed; }
.min-h-screen.bg-slate-50 table thead tr, .min-h-screen.bg-slate-50 table th { background: #fafbfc; }
.min-h-screen.bg-slate-50 .bg-blue-50 { background: #f5f6e8; }
@media print {
  @page { margin: 14mm; }
  #hub-shell, #hub-topbar, .hs-reopen { display: none !important; }
  .md\:ml-72 { margin-left: 0 !important; }
  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Dashboard stat tiles: 9 across on wide screens, grouped by color and label */
.hub-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1200px) { .hub-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media print { .hub-apps { display: none; } }