/* Shared building blocks used by more than one page: controls, the app shell, feedback,
   tables and lists, and the ish-* page primitives. Page-only styles live in pages/*.css.
   Components that take a status colour read --tone; set it with the tone-* utilities in app.css. */

/* ── Page layout ─────────────────────────────────────────────────────────── */
.ish-page { display: flex; flex-direction: column; gap: 18px; }

.ish-panel { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-raised); }

.ish-panel--empty { display: grid; min-height: 300px; place-items: center; border: 2px dashed var(--line); box-shadow: none; color: var(--muted); text-align: center; }

.ish-empty-icon { display: block; margin-bottom: 10px; color: var(--faint); font-size: 56px; }

.ish-muted { color: var(--muted); }

.ish-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ish-section-title { margin: 0 0 12px; color: var(--ink); font-size: 1rem; font-weight: 800; }

/* The large page glyph beside a page title: same treatment as the header logo mark, a plain brand glyph with no tile. */
.ish-hero-icon {
  display: inline-flex; width: 46px; height: 46px; flex: none; align-items: center; justify-content: center;
  background: transparent; color: var(--brand); font-size: 34px;
}

@media (max-width: 620px) {
  .ish-page { gap: 14px; }

  .ish-panel { padding: 15px; }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.fl-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  color: var(--ink); font: inherit; font-weight: 700; font-size: 0.86rem; white-space: nowrap; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.fl-btn:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }

.fl-btn--primary, .fl-ref-add {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding-inline: 14px;
  border: none; border-radius: var(--radius); background: var(--brand); color: var(--on-brand);
  font: inherit; font-size: 0.86rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  flex-shrink: 0; transition: background .14s ease;
}

.fl-btn--primary:hover, .fl-ref-add:hover {
  background: var(--brand-strong); color: var(--on-brand); text-decoration: none;
}

/* Button icons would otherwise take the label's small text size, too small to read. */
.fl-btn .msr, .fl-ref-add .msr { font-size: 18px; }

.fl-btn--danger { background: var(--error); border-color: var(--error); color: #fff; }

.fl-btn--danger:hover { background: var(--error); border-color: var(--error); filter: brightness(0.93); }

.fl-btn:focus-visible, .fl-btn--primary:focus-visible, .fl-ref-add:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-tint);
}

.fl-btn--danger:focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--error-bg);
}

/* Square icon buttons: the topbar, table row actions, and card actions. */
.fl-iconbutton, .fl-rowactions button, .fl-rowactions a {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--muted); cursor: pointer; text-decoration: none;
}

.fl-iconbutton:hover, .fl-rowactions button:hover, .fl-rowactions a:hover { background: var(--sunken); color: var(--brand); text-decoration: none; }

.fl-iconbutton.danger, .fl-rowactions .danger { color: var(--error); }

.fl-iconbutton:focus-visible, .fl-rowactions button:focus-visible, .fl-rowactions a:focus-visible {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}

.fl-ref-iconbtn {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer;
  transition: border-color .14s, color .14s;
}

.fl-ref-iconbtn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); text-decoration: none; }

.fl-ref-iconbtn .msr { font-size: 18px; }

.fl-ref-iconbtn--danger { color: var(--error); }

.fl-ref-iconbtn--danger:hover:not(:disabled) { border-color: var(--error); color: var(--error); }

.fl-ref-iconbtn:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

.fl-ref-iconbtn--danger:focus-visible { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }

/* A borderless text button, e.g. "clear filters". */
.ish-projects-reset { padding: 0 4px; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 800; cursor: pointer; }

.ish-projects-reset:hover { text-decoration: underline; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.fl-input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.88rem; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.fl-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

.fl-input:disabled, .fl-sel-btn:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  border-color: var(--disabled-border);
  opacity: 1;
  cursor: not-allowed;
}

.fl-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

.fl-field { display: flex; flex-direction: column; min-width: 0; }

.fl-fieldhint { margin-top: 5px; font-size: .74rem; color: var(--faint); text-wrap: pretty; }

.fl-formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.fl-formgrid + .fl-switchrow { margin-top: 16px; }

.fl-formgrid--compact { gap: 12px; }

.fl-formgrid--compact .fl-label { font-size: .74rem; margin-bottom: 4px; }

.fl-formgrid--compact .fl-input { height: 36px; font-size: .85rem; }

.fl-formgrid--compact .fl-fieldhint { margin-top: 3px; font-size: .72rem; }

.ish-field--full { grid-column: 1 / -1; }

.ish-req { margin-inline-start: 3px; color: var(--error); font-weight: 800; }

/* An input with an icon on the right. Physical sides on purpose: .msr icons and these
   inputs (email, URL, password) are direction: ltr, so logical sides would flip to the left. */
.ish-input-icon { position: relative; }

.ish-input-icon .msr { position: absolute; top: 50%; right: 11px; color: var(--faint); font-size: 18px; transform: translateY(-50%); pointer-events: none; }

.ish-input-icon .fl-input { padding-right: 36px; }

.fl-checkrow { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .78rem; cursor: pointer; }

.fl-checkrow input { margin-top: 3px; accent-color: var(--brand); }

.fl-checkrow span { display: flex; flex-direction: column; }

.fl-checkrow small { color: var(--faint); }

.fl-file-input { width: 100%; min-height: 42px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); font: inherit; font-size: .78rem; }

.fl-file-input::file-selector-button { height: 32px; margin-inline-end: 10px; padding-inline: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }

.fl-file-input::file-selector-button:hover { border-color: var(--brand); color: var(--brand); }

@media (max-width: 720px) {
  .fl-formgrid { gap: 11px; }
}

@media (max-width: 620px) {
  .fl-formgrid { grid-template-columns: 1fr; }
}

/* ── Modal forms ─────────────────────────────────────────────────────────── */
.fl-modal-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}

.ish-modal-form { display: grid; gap: 14px; }

.ish-modal-form .fl-formgrid { gap: 13px; }

.ish-modal-form .fl-input, .ish-modal-form .fl-sel-btn { width: 100%; min-height: 40px; }

.ish-modal-form textarea.fl-input { min-height: 92px; resize: vertical; }

.ish-modal-form .validation-message { margin-top: 5px; font-size: .74rem; font-weight: 700; }

/* ── App shell: topbar, brand and user menu ──────────────────────────────── */
.fl-shell { min-height: 100dvh; background: var(--bg); color: var(--ink); }

.fl-topbar {
  position: sticky; top: 0; z-index: 40; background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}

.fl-topbar-inner {
  max-width: 1320px; min-height: 62px; margin: 0 auto; padding: 7px 28px;
  display: flex; align-items: center; gap: 18px;
}

.fl-brandband { display: flex; align-items: center; gap: 10px; min-width: 158px; color: var(--ink); }

.fl-brandband:hover { text-decoration: none; color: var(--ink); }

.fl-brandcopy { display: flex; flex-direction: column; line-height: 1.12; white-space: nowrap; }

.fl-brandband b { font-size: 1rem; font-weight: 850; }

.fl-brandband small {
  margin-top: 4px; color: var(--faint); font-family: Arial, sans-serif; font-size: .56rem;
  font-weight: 800; letter-spacing: .22em; line-height: 1; text-align: start;
}

.fl-brandmark { display: grid; width: 46px; height: 46px; place-items: center; flex-shrink: 0; background: transparent; color: var(--brand); font-size: 31px; }

.fl-brandmark svg { width: 27px; height: 27px; }

.fl-topactions { display: flex; align-items: center; gap: 7px; margin-inline-start: auto; }

.fl-topactions .fl-iconbutton { border-color: transparent; background: transparent; }

.fl-topactions .fl-iconbutton .msr { font-size: 20px; }

.fl-main { max-width: 1320px; margin: 0 auto; padding: 30px 28px 64px; }

.fl-usermenu { position: relative; flex-shrink: 0; }

.fl-avatar-btn {
  display: inline-flex; align-items: center; gap: 8px; padding-block: 4px; padding-inline: 8px 4px;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent;
  color: var(--ink); cursor: pointer; font: inherit; font-weight: 700; font-size: .8rem;
}

.fl-avatar-btn:hover { background: var(--sunken); }

.fl-avatar {
  width: 30px; height: 30px; border-radius: var(--radius); flex-shrink: 0;
  background: var(--brand); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 800;
}

.fl-avatar-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fl-avatar-caret { font-size: 18px; color: var(--faint); transition: transform .16s ease; }

.fl-menu-backdrop { position: fixed; inset-block-start: 0; inset-inline: 0; height: 100dvh; z-index: 50; }

.fl-menu {
  position: absolute; z-index: 51; top: calc(100% + 6px); inset-inline-end: 0; min-width: 244px;
  padding: 4px; display: flex; flex-direction: column; gap: 2px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-lg);
  animation: app-pop .14s ease backwards;
}

.fl-menu-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 11px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px;
}

.fl-menu-user .fl-avatar { width: 34px; height: 34px; }

.fl-menu-user-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.fl-menu-user-name { font-size: .86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fl-menu-user-role { font-size: .72rem; color: var(--faint); }

.fl-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 4px; background: transparent; color: var(--ink);
  font: inherit; font-size: .88rem; font-weight: 600; text-align: start; cursor: pointer;
  white-space: nowrap; text-decoration: none;
}

.fl-menu-item:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.fl-menu-item .msr { font-size: 19px; color: var(--muted); }

.fl-menu-sep { height: 1px; background: var(--line-soft); margin: 4px 8px; }

.fl-menu-item--danger { color: var(--error); }

.fl-menu-item--danger:hover:not(:disabled) { background: var(--error-bg); color: var(--error); }

.fl-menu-item--danger .msr { font-size: 19px; color: var(--error); }

[dir="rtl"] .fl-menu-item--danger .msr { transform: scaleX(-1); }

@media (max-width: 720px) {
  .fl-topbar-inner { min-height: 58px; padding: 8px 12px; gap: 8px; }

  .fl-brandband { min-width: 0; }

  .fl-brandband small { font-size: .5rem; letter-spacing: .18em; }

  .fl-brandband b { font-size: .9rem; }

  .fl-brandmark { width: 38px; height: 38px; border-radius: 8px; font-size: 26px; }

  .fl-brandmark svg { width: 23px; height: 23px; }

  .fl-avatar-name, .fl-avatar-caret { display: none; }

  .fl-avatar-btn { padding: 3px; border-radius: var(--radius); }

  .fl-topactions { gap: 4px; }

  .fl-main { padding: 20px 12px 70px; }
}

/* ── Auth layout (sign-in, error and status pages) ───────────────────────── */
html:has(.fl-auth-page) { overflow-y: auto; scrollbar-width: none; }

html:has(.fl-auth-page)::-webkit-scrollbar { display: none; }

.fl-auth-page { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 78px 16px; background: var(--bg); }

.fl-auth-titlebar { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 40; min-height: 62px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }

.fl-auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 36px 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); animation: app-pop .3s ease backwards; }

.fl-auth-form { display: flex; flex-direction: column; gap: 14px; }

.fl-auth-form .fl-input, .fl-auth-form .fl-sel-btn { height: 46px; border-radius: 10px; }

.fl-auth-submit { justify-content: center; width: 100%; min-height: 46px; margin-top: 4px; }

/* ── Feedback: alerts and toasts ─────────────────────────────────────────── */
.fl-alert { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border: 1px solid transparent; border-radius: var(--radius); font-size: .8rem; }

.fl-alert--error { color: var(--error); background: var(--error-bg); border-color: color-mix(in srgb, var(--error) 25%, transparent); }

.fl-alert--warning { color: var(--warning); background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }

.fl-alert--info { color: var(--info); background: var(--info-bg); }

.fl-alert .msr { flex: none; font-size: 18px; }

.fl-toast-host {
  position: fixed; z-index: 10020; inset-inline-end: 22px; top: calc(62px + 16px); bottom: auto;
  display: flex; flex-direction: column; gap: 9px; align-items: stretch;
  max-width: min(390px, calc(100vw - 32px)); pointer-events: none;
}

.fl-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 9px; padding: 12px 13px; border-radius: 7px;
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-lg); animation: app-pop .18s ease backwards;
  font-size: .82rem; font-weight: 700;
}

.fl-toast--success { background: var(--success); color: #fff; }

.fl-toast button { margin-inline-start: auto; border: 0; background: none; color: inherit; cursor: pointer; }

@media (max-width: 720px) {
  .fl-toast-host { inset-inline: 16px; top: calc(58px + 12px); bottom: auto; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fl-menu, .fl-toast, .fl-auth-card { animation: none; }
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.fl-tablewrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }

.fl-table { width: 100%; border-collapse: collapse; font-size: .78rem; }

.fl-table th { padding: 11px 13px; background: var(--surface-2); color: var(--muted); text-align: start; font-size: .7rem; white-space: nowrap; }

.fl-table td { padding: 12px 13px; border-top: 1px solid var(--line-soft); vertical-align: middle; }

.fl-table td small { display: block; margin-top: 3px; color: var(--faint); }

.fl-table th.fl-col-num, .fl-table td.fl-col-num { text-align: center; }

.fl-data-grid .fl-table th:not(.fl-col-desc):not(.fl-col-start), .fl-data-grid .fl-table td:not(.fl-col-desc):not(.fl-col-start) { text-align: center; }

.fl-data-grid .fl-table th.fl-col-start, .fl-data-grid .fl-table td.fl-col-start { text-align: start; }

.fl-data-grid .fl-table td .fl-rowactions, .fl-data-grid .fl-table td .ish-inline { justify-content: center; }

.fl-table th.fl-col-date, .fl-table td.fl-col-date { width: 1%; white-space: nowrap; }

.fl-table th.fl-col-desc, .fl-table td.fl-col-desc { width: 40%; }

.fl-rowactions { display: flex; justify-content: flex-end; gap: 5px; }

.fl-rowactions .msr { font-size: 17px; }

.fl-actionscol { width: 110px; }

.ish-cell-main { font-weight: 750; }

.ish-cell-sub { display: block; margin-top: 3px; color: var(--faint); font-size: .69rem; }

.ish-journal-date { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ish-journal-method { color: var(--muted); white-space: nowrap; }

.ish-journal-method > span { display: inline-flex; align-items: center; gap: 5px; }

.ish-journal-method .msr { color: var(--faint); font-size: 16px; }

.ish-journal-amount strong { font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ish-journal-amount--in strong { color: var(--success); }

.ish-journal-amount--out strong { color: var(--error); }

.ish-journal-amount--owner strong { color: var(--info); }

/* On phones, tables inside .ish-table-cards become one card per row. The page lays out
   each row's cells with grid-template-areas and maps td:nth-child(n) to an area. */
.ish-list-panel .fl-tablewrap, .ish-table-cards .fl-tablewrap { border-color: var(--line-soft); border-radius: 10px; }

@media (max-width: 620px) {
  /* Qualified with .fl-data-grid to outrank the grid's own wrapper rule in controls.css, which loads later. */
  .ish-table-cards .fl-tablewrap, .ish-table-cards.fl-data-grid .fl-tablewrap, .ish-table-cards .fl-data-grid .fl-tablewrap { overflow: visible; border: 0; background: transparent; }

  .ish-table-cards .fl-table thead { display: none; }

  .ish-table-cards .fl-table tbody tr { display: grid; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line-soft); }

  .ish-table-cards .fl-table tbody td { display: block; width: auto !important; min-width: 0; padding: 0; border: 0; text-align: start !important; }
}

/* ── Lists ───────────────────────────────────────────────────────────────── */
.fl-data-list__items {
  overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}

.fl-data-list__item { border-top: 1px solid var(--line-soft); }

.fl-data-list__item:first-child { border-top: 0; }

.fl-data-list__skeleton {
  display: flex; align-items: center; gap: 13px; min-height: 72px; padding: 15px 20px;
  border-top: 1px solid var(--line-soft);
}

.fl-data-list__skeleton:first-child { border-top: 0; }

.fl-data-list__skelcopy { display: flex; flex: 1; flex-direction: column; gap: 9px; }

/* A data list whose items are separate cards in a grid; the page sets the columns. */
.ish-card-list .fl-data-list__items { display: grid; gap: 12px; overflow: visible; border: 0; background: transparent; }

.ish-card-list .fl-data-list__item { border: 0; }

/* A page's list area: search, optional filter chips and the list or table, in one panel. */
.ish-list-panel { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 16px; }

.ish-list-panel > .fl-search { flex: none; width: 100%; max-width: none; }

@media (max-width: 620px) {
  .ish-list-panel { padding: 15px; }
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.ish-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .12s ease; }

.ish-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }

.ish-card-head, .ish-card-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.ish-card-head h2, .ish-card-head h3 { margin: 0; font-size: .98rem; }

.ish-card-foot { align-items: center; color: var(--muted); font-size: .75rem; }

.ish-card-actions { display: flex; gap: 5px; }

/* ── Page header: breadcrumb and title panel (PageHeader.razor) ──────────── */
.ish-breadcrumb { display: flex; min-width: 0; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }

.ish-breadcrumb a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; margin-inline-start: -8px; border-radius: 6px; color: var(--brand); }

.ish-breadcrumb a:hover { background: var(--brand-tint-2); text-decoration: none; }

.ish-breadcrumb a .msr { font-size: 17px; }

.ish-breadcrumb .ish-breadcrumb-mid { display: inline-block; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ish-breadcrumb-sep { color: var(--faint); font-size: 18px; }

.ish-breadcrumb [aria-current] { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }

.ish-page-hero { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }

.ish-page-hero-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.ish-page-hero-title { display: flex; min-width: 160px; flex: 1; align-items: center; gap: 8px; flex-wrap: wrap; }

.ish-page-hero-title h1 { margin: 0; color: var(--ink); font-size: 1.35rem; font-weight: 800; line-height: 1.2; }

.ish-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 620px) {
  .ish-page-hero { padding: 16px; }

  .ish-page-actions { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* A lone or odd last action takes the whole row instead of half of it. */
  .ish-page-actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }

  .ish-page-actions .fl-btn { justify-content: center; }

  /* The page title already names the current page, so the trail keeps only the way back and
     gives the project name the room it would otherwise share with the title. */
  .ish-breadcrumb [aria-current], .ish-breadcrumb-sep:nth-last-child(2) { display: none; }

  .ish-breadcrumb .ish-breadcrumb-mid { min-width: 0; max-width: none; }
}

/* ── No access (PageContent.razor) ───────────────────────────────────────── */
.ish-no-access { display: flex; max-width: 560px; margin: 40px auto 0; flex-direction: column; align-items: center; gap: 10px; padding: 36px 28px; text-align: center; }

.ish-no-access-icon { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; margin-bottom: 4px; border-radius: 50%; background: var(--warning-bg); color: var(--warning); font-size: 32px; }

.ish-no-access h1 { margin: 0; color: var(--ink); font-size: 1.2rem; font-weight: 800; }

.ish-no-access p { max-width: 42ch; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.7; }

.ish-no-access .fl-btn { margin-top: 8px; }

.ish-no-access-actions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.ish-no-access-actions form { margin: 0; }

@media (max-width: 620px) {
  .ish-no-access { padding: 15px; }
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.ish-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 9px; border-radius: 999px; background: var(--info-bg); color: var(--info); font-size: .69rem; font-weight: 800; white-space: nowrap; }

.ish-badge--success { background: var(--success-bg); color: var(--success); }

.ish-badge--danger { background: var(--error-bg); color: var(--error); }

.ish-badge--warning { background: var(--warning-bg); color: var(--warning); }

.ish-badge--neutral { background: var(--surface-2); color: var(--muted); }

.ish-badge--info { background: var(--info-bg); color: var(--info); }

/* ── Filter chips: a toned dot, the label and a count ────────────────────── */
.ish-project-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.ish-project-chip {
  --tone: var(--brand);
  display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding-block: 4px; padding-inline: 8px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted);
  font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}

.ish-project-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }

.ish-project-chip span {
  min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2);
  color: var(--ink); font-size: .7rem; font-weight: 800; text-align: center;
}

.ish-project-chip:hover:not(:disabled) { border-color: var(--tone); color: var(--ink); }

.ish-project-chip[aria-pressed="true"] { border-color: var(--tone); background: var(--brand-tint-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--tone); }

.ish-project-chip[aria-pressed="true"] span { background: var(--tone); color: var(--on-brand); }

.ish-project-chip:disabled { cursor: default; }

.ish-project-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-tint); }

@media (max-width: 620px) {
  .ish-project-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -2px; padding: 2px; scrollbar-width: none; }

  .ish-project-chip { flex: none; }
}

/* ── Progress bar: <div class="ish-project-progress"><span style="width: n%"></span></div> ── */
.ish-project-progress { height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }

.ish-project-progress span { display: block; height: 100%; border-radius: inherit; background: var(--tone); transition: width .3s ease; }

/* ── Phone number with a copy button (ProjectPhone.razor) ────────── */
.ish-project-phone { position: relative; z-index: 1; display: inline-flex; max-width: 100%; align-self: flex-start; align-items: center; gap: 2px; margin-top: 2px; margin-inline-start: -4px; }

.ish-project-phone-number {
  padding: 1px 4px; border-radius: 4px; color: var(--muted); font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: text; user-select: all; -webkit-user-select: all;
}

.ish-project-phone-number:hover { background: var(--surface-2); color: var(--ink); }

.ish-project-phone-btn {
  display: inline-flex; width: 26px; height: 26px; flex: none; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}

.ish-project-phone-btn .msr { font-size: 16px; }

.ish-project-phone-btn:hover { background: var(--brand-tint-2); color: var(--brand); text-decoration: none; }

.ish-project-phone-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand-tint); color: var(--brand); }

.ish-project-phone-btn.is-copied, .ish-project-phone-btn.is-copied:hover { background: var(--success-bg); color: var(--success); }

.ish-project-phone-btn:disabled { cursor: default; opacity: .6; }

/* ── Contact avatar: a person's initial in a brand circle ────────────────── */
.ish-contact-avatar {
  display: inline-flex; width: 38px; height: 38px; flex: none; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: 1rem; font-weight: 800;
}

.ish-contact-empty { color: var(--faint); font-size: .76rem; }

/* ── Money summaries: a row of figures (journal and contracts) ───────────── */
.ish-journal-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }

.ish-journal-figure { --tone: var(--ink); min-width: 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }

.ish-journal-figure--in { --tone: var(--success); }

.ish-journal-figure--out { --tone: var(--error); }

.ish-journal-figure--owner { --tone: var(--info); }

.ish-journal-figure--total { --tone: var(--ink); background: var(--surface-2); }

.ish-journal-figure dt { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .74rem; font-weight: 700; }

.ish-journal-figure dt .msr { color: var(--tone); font-size: 17px; }

.ish-journal-figure dd { margin: 3px 0 0; color: var(--tone); font-size: 1rem; font-weight: 850; font-variant-numeric: tabular-nums; }

.ish-journal-figure small { display: block; overflow: hidden; color: var(--faint); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .ish-journal-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .ish-journal-figures { gap: 8px; }

  .ish-journal-figure dd { font-size: .95rem; }

  /* Half-width tiles are too narrow to cut the note to one line. */
  .ish-journal-figure small { white-space: normal; }
}
