/* ============================================================
   Fundraise Tap v2 — desktop admin shell, modal, annotations
   (loaded after hifi.css)
   ============================================================ */

/* sticky-note annotation (now brand-tinted, info colour) */
.note {
  position: relative; background: var(--info-soft); border: 1px solid #cfe0f1;
  border-left: 3px solid var(--info); color: #1f4a78; border-radius: var(--r-sm);
  padding: 12px 14px; font-size: 13px; line-height: 1.5; max-width: 260px;
}
.note b { color: var(--info); }
.note .note-k { display: inline-block; font-family: var(--mono); font-size: 10px; color: var(--info); border: 1px solid #cfe0f1; border-radius: 4px; padding: 1px 6px; margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }

/* ---------------- admin shell ---------------- */
.admin { width: 1440px; height: 900px; flex: none; background: var(--bg); display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 64px 1fr; grid-template-areas: "brand topbar" "nav main"; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.admin-brand { grid-area: brand; background: var(--nav-bg); color: var(--nav-text); display: flex; align-items: center; gap: 12px; padding: 0 20px; border-right: 1px solid var(--nav-border); border-bottom: 1px solid var(--nav-border); }
.admin-brand .logo-sq { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.admin-nav { grid-area: nav; background: var(--nav-bg); border-right: 1px solid var(--nav-border); padding: 14px 12px; overflow: hidden; display: flex; flex-direction: column; }
.admin-nav .nav-search { position: relative; margin-bottom: 16px; }
.admin-nav .nav-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--nav-text-muted); pointer-events: none; }
/* White field on the tinted sidebar, rather than tint-on-tint. */
.admin-nav .nav-search input { width: 100%; box-sizing: border-box; border: 1px solid var(--nav-border); background: #fff; border-radius: 10px; padding: 12px 14px 12px 42px; font-size: 14px; line-height: 1.3; color: var(--nav-text); }
.admin-nav .nav-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.admin-nav .nav-search input::placeholder { color: var(--nav-text-muted); }
.admin-nav .nav-main { flex: 1 1 auto; overflow-y: auto; }
.admin-nav .nav-empty { padding: 10px 14px; font-size: 13px; color: var(--nav-text-muted); }
.admin-nav .nav-foot { flex: none; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--nav-border); }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--nav-text-muted); text-decoration: none; margin-bottom: 2px; cursor: pointer; transition: .12s; }
.admin-nav a svg { width: 19px; height: 19px; opacity: .85; flex: none; }
.admin-nav a:hover { background: var(--nav-hover-bg); color: var(--nav-text); }
.admin-nav a.on { background: var(--nav-active-bg); color: var(--nav-text); font-weight: 600; }
.admin-nav a.on svg { opacity: 1; }
.admin-nav a:focus-visible, .nav-support > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Help & Support disclosure in the sidebar footer */
.nav-support > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--nav-text-muted); cursor: pointer; list-style: none; user-select: none; transition: .12s; }
.nav-support > summary::-webkit-details-marker { display: none; }
.nav-support > summary svg { width: 19px; height: 19px; opacity: .85; flex: none; }
.nav-support > summary:hover { background: var(--nav-hover-bg); color: var(--nav-text); }
.nav-support > summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s ease; }
.nav-support[open] > summary { color: var(--nav-text); }
.nav-support[open] > summary .chev { transform: rotate(180deg); }
.nav-support-items { margin: 2px 0 4px 23px; padding-left: 8px; border-left: 1px solid var(--nav-border); }
.nav-support-items a { font-size: 13px; padding: 8px 12px; gap: 10px; }
.nav-support-items a svg { width: 16px; height: 16px; }

/* Topbar placement: items float over the page so the header row keeps its
   height. Anchor styling is restated here because the sidebar's base rules
   are scoped to .admin-nav, which the topbar copy sits outside of. */
.top-support { position: relative; flex: none; }
.top-support > summary { padding: 8px 12px; font-size: 13px; gap: 8px; }
.top-support > summary svg { width: 17px; height: 17px; }
.top-support > summary .chev { margin-left: 0; width: 15px; height: 15px; }
.top-support .nav-support-items {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  min-width: 226px; margin: 0; padding: 6px;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--el-pop);
}
.top-support .nav-support-items a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none;
  white-space: nowrap; transition: .12s;
}
.top-support .nav-support-items a:hover { background: var(--surface); color: var(--primary); }
.top-support .nav-support-items a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.admin-top { grid-area: topbar; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.admin-main { grid-area: main; overflow-y: auto; background: var(--bg); }
.admin-main-inner { max-width: 1200px; margin: 0 auto; padding: 32px; }

/* signed-in user chip in the top bar */
.user-chip { display: flex; align-items: center; gap: 10px; max-width: 220px; padding: 4px 12px 4px 4px; border-radius: 999px; text-decoration: none; color: var(--text); transition: background .12s; }
.user-chip:hover { background: var(--surface); }
.user-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-chip .avatar, .user-chip .user-chip-pic { width: 34px; height: 34px; flex: none; }
.user-chip .user-chip-pic { border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--border); }
.user-chip-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-chip-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: 11px; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Account menu: the chip is now a disclosure. Same <details> pattern as the
   Help & Support dropdown beside it, so keyboard and screen-reader behaviour
   comes from the browser. */
.user-menu { position: relative; flex: none; }
.user-menu > summary {
  display: flex; align-items: center; gap: 10px; max-width: 240px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  color: var(--text); cursor: pointer; list-style: none; user-select: none;
  transition: background .12s;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface); }
.user-menu > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-menu > summary .avatar, .user-menu > summary .user-chip-pic { width: 34px; height: 34px; flex: none; }
.user-menu > summary .user-chip-pic { border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--border); }
.user-menu > summary .chev { width: 15px; height: 15px; flex: none; opacity: .7; transition: transform .15s ease; }
.user-menu[open] > summary { background: var(--surface); }
.user-menu[open] > summary .chev { transform: rotate(180deg); }
/* Name, role and address stacked in the chip (TASK 07). Each line truncates
   on its own so a long address cannot widen the bar. */
.user-menu > summary .user-chip-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-menu > summary .user-chip-mail { font-size: 11px; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The chip already says who and what; the panel head would repeat it. It is
   kept in the markup for narrow screens, where the chip is only an avatar. */
.user-menu-head { display: none; }
.user-menu-items {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  min-width: 232px; padding: 6px;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--el-pop);
}
/* The login type — "System Admin", "Charity Admin" — with the address it
   belongs to, so it is clear which account is signed in before you act. */
.user-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu-head .user-chip-role { font-size: 12px; font-weight: 600; color: var(--primary); }
.user-menu-email { font-size: 12px; color: var(--text-subtle); overflow-wrap: anywhere; }
.user-menu-items a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none;
  white-space: nowrap; transition: .12s;
}
.user-menu-items a svg { width: 17px; height: 17px; flex: none; }
.user-menu-items a:hover { background: var(--surface); color: var(--primary); }
.user-menu-items a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.user-menu-items form { margin: 0; }

/* Sign out (TASK 07). Same shape as the rows above it, separated by a rule and
   reddened on hover — it is the only row here that ends the session. */
.user-menu-sep { height: 1px; background: var(--border); margin: 5px 8px; }
.user-menu-out {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 8px; background: none;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-muted);
  text-align: left; cursor: pointer; transition: .12s;
}
.user-menu-out svg { width: 17px; height: 17px; flex: none; }
.user-menu-out:hover { background: var(--error-soft); color: var(--error); }
.user-menu-out:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* Help & Support nested in the account panel (TASK 07): a flyout beside the
   panel rather than an inline expand, so opening it does not push Sign out
   down the screen. Click-driven like every other <details> here — a hover-only
   submenu is unreachable by keyboard and does not exist on touch. */
.acct-support { position: relative; }
.acct-support > summary { padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-muted); gap: 10px; }
.acct-support > summary svg { width: 17px; height: 17px; }
.acct-support > summary:hover { background: var(--surface); color: var(--primary); }
.acct-support[open] > summary { background: var(--surface); color: var(--primary); }
.acct-support > summary .chev { margin-left: auto; width: 14px; height: 14px; opacity: .55; transition: transform .15s ease; }
.acct-support[open] > summary .chev { transform: rotate(90deg); }
.acct-support .nav-support-items {
  position: absolute; top: -6px; right: calc(100% + 8px); z-index: 210;
  min-width: 208px; margin: 0; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-left: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--el-pop);
}
.acct-support .nav-support-items a { font-size: 13px; padding: 9px 12px; gap: 10px; color: var(--text-muted); }
.acct-support .nav-support-items a:hover { background: var(--surface); color: var(--primary); }

/* Two-factor status, beside Log out. A slow flash rather than a static badge:
   2FA being off is a standing problem, and a still dot reads as decoration. */
.tfa-status {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; transition: .12s;
}
.tfa-status .tfa-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; animation: tfa-flash 2.4s ease-in-out infinite; }
.tfa-status.is-on { color: #15703f; background: var(--success-soft); border-color: #bfe3cd; }
.tfa-status.is-on .tfa-dot { background: var(--success); }
.tfa-status.is-off { color: var(--error); background: var(--error-soft); border-color: #e9b8b8; }
.tfa-status.is-off .tfa-dot { background: var(--error); }
.tfa-status:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@keyframes tfa-flash { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
/* Anyone who asked for less motion gets a plain dot; the colour still carries
   the state, so nothing is lost. */
@media (prefers-reduced-motion: reduce) { .tfa-status .tfa-dot { animation: none; } }

/* The logo is a link back to the dashboard — it must not pick up default
   anchor colour or underline. */
.brand-link { display: inline-flex; align-items: center; text-decoration: none; border-radius: 6px; }
.brand-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* page footer — flows after page content (block layout, so existing pages are untouched) */
/* Type matched to the left menu (.admin-nav a): 14px / 500. Was 12px and read
   as fine print next to it. Colour stays --text-subtle — the footer should sit
   quieter than the nav, it just should not be a different size. */
.admin-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text-subtle); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-main::-webkit-scrollbar { width: 10px; }
.admin-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 3px solid #fff; }

/* KPI */
/* auto-fit rather than a fixed four: the dashboards carry five cards since the
   fee split (TASK 08), and other pages still pass four. A fixed count left the
   fifth card alone on a second row at full width. */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 20px; }
.kpi .l { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.kpi .v { font-size: 30px; font-weight: 600; margin-top: 10px; letter-spacing: -.01em; }
.kpi .s { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.kpi .s.up { color: var(--success); }
.kpi .s.down { color: var(--error); }

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th { position: sticky; top: 0; background: #fff; text-align: left; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.tbl td { padding: 0 16px; height: 56px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:nth-child(even) td { background: var(--surface); }
/* Long donor emails truncate rather than forcing the table wider. */
.tbl .cell-ellipsis { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--primary-soft); }
/* Money that went back: a refunded donation, a cancelled subscription. Tinted
   so the row reads as an exception while scanning, without hiding the figures.
   Declared after the zebra-striping and the hover rules, which it ties with on
   specificity, so it is the one that applies. */
.tbl tbody tr.is-reversed td { background: var(--error-soft); }
.tbl tbody tr.is-reversed.click:hover td { background: #f7d9d9; }

/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.tabs .tab { padding: 12px 16px; font-size: 14px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.tabs .tab.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.tabs .tab:hover { color: var(--primary); }

/* filter bar */
/* One control height across the bar, so the search field, the selects, the
   date inputs and the buttons all line up. Height comes from --ctl-h rather
   than per-control padding, which is what let them drift apart. */
.filter-bar { --ctl-h: 46px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar .search, .filter-bar .filter, .filter-bar .btn { min-height: var(--ctl-h); }
/* Buttons are pills (999px) elsewhere, but at toolbar height that reads as an
   oval beside the 6px-radius inputs. Square them off inside the bar only. */
.filter-bar .btn { border-radius: var(--r-sm); }
.filter { display: inline-flex; align-items: center; gap: 7px; min-height: var(--ctl-h); border: 1px solid var(--border); background: #fff; border-radius: var(--r-sm); padding: 0 13px; font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; }
select.filter { padding-right: 34px; }
.filter:hover { border-color: var(--primary); color: var(--primary); }
/* From / To pair. Grouped so the two dates and their labels stay together when
   the filter bar wraps — a "To" box on its own line reads as a third filter. */
.date-range { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-range label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 16px; background: #fff; min-width: 320px; min-height: 46px; transition: border-color .12s, box-shadow .12s; }
/* The inner input clears its own outline, so the focus ring lives on the wrapper. */
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search svg { color: var(--text-subtle); flex: none; }
.search input { border: 0; outline: 0; font-family: var(--font); font-size: 15px; line-height: 22px; flex: 1; min-width: 0; color: var(--text); background: transparent; }
.search input::placeholder { color: var(--text-subtle); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search:has(input:disabled) { background: var(--surface); }

/* report cards — Reports page downloads */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; align-items: stretch; }
.report-card { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.report-card-head { display: flex; align-items: flex-start; gap: 14px; }
.report-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.report-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.report-meta dt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); font-weight: 600; }
.report-meta dd { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* Network Status widget — admin footer */
.net-status { display: inline-flex; align-items: center; gap: 8px; }
.net-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-subtle); }
.net-dot.is-online { background: var(--success); animation: net-pulse 2.4s ease-in-out infinite; }
.net-dot.is-offline { background: var(--error); animation: net-pulse 2.4s ease-in-out infinite; }
.net-dot.is-checking { background: var(--text-subtle); }
@keyframes net-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* A flashing dot is a distraction for anyone who asked for less motion; the
   colour and the label still carry the state. */
@media (prefers-reduced-motion: reduce) { .net-dot { animation: none !important; } }

/* Direct Debit option — charity Account page */
.dd-option { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); flex-wrap: wrap; }
.dd-option .dd-body { flex: 1 1 220px; }
.dd-option .dd-body p { margin: 0; }
.dd-icon { width: 40px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }

/* resource link cards — Charity → Links */
/* min(280px, 100%) rather than a bare 280px: on a narrow phone the track would
   otherwise stay wider than the screen and push the page sideways. */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.link-card { padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.link-card .t-h3 { margin: 0; }
.link-card p { margin: 0; flex: 1 1 auto; }
.link-card .btn { margin-top: 6px; }
.link-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }

/* Gift Aid declaration form */
.ga-form { padding: 26px; max-width: 900px; }
.ga-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.ga-form .field .req { color: var(--error); }
.ga-form .field-hint { margin: 6px 0 0; font-size: 12px; color: var(--text-subtle); }
.ga-form .field-err { margin: 6px 0 0; font-size: 12px; color: var(--error); }
.ga-form .input[readonly] { background: var(--surface); color: var(--text-muted); cursor: default; }
.ga-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Gift Aid information card — donation detail */
.ga-card { padding: 26px; }
.ga-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ga-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px 24px; margin: 0; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ga-grid dt, .ga-legal dt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); font-weight: 600; }
.ga-grid dd { margin: 6px 0 0; font-size: 15px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.ga-span { grid-column: 1 / -1; }
.ga-note { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--text-subtle); }
.ga-warn { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; line-height: 1.5; color: #8a5a00; background: var(--warning-soft); border-left: 3px solid var(--warning); border-radius: var(--r-sm); padding: 8px 10px; }
.ga-legal { padding-top: 20px; }
.ga-legal dd { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; }
.ga-card-foot { margin-top: 20px; }

/* connection card */
.conn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }
.conn { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
/* Disconnect reads as a real (cautionary) button, not a faint text link. */
.btn-danger-soft { background: #fff; color: var(--error); border: 1px solid #e7c3c0; }
.btn-danger-soft:hover { border-color: var(--error); background: #fdf4f3; }
.conn .top { display: flex; align-items: center; gap: 12px; }
.conn .logo { width: 40px; height: 40px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; color: var(--text-subtle); flex: none; }
.logo img { width: 26px; height: 26px; border-radius: 5px; object-fit: contain; }
.logo img + .logo-fallback { display: none; } /* fallback shows only when the favicon fails to load */
.conn .conn-status { display: flex; flex-direction: column; gap: 4px; min-height: 20px; justify-content: center; }
.conn .conn-status .badge { align-self: flex-start; }
.conn .conn-actions { margin-top: auto; padding-top: 4px; }

/* collapsible credentials inside a connection card */
.conn-details { border-top: 1px solid var(--border); padding-top: 10px; }
.conn-details summary { display: flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); user-select: none; }
.conn-details summary::-webkit-details-marker { display: none; }
.conn-details summary:hover { color: var(--primary); }
.conn-details summary .chev { margin-left: auto; transition: transform .15s ease; }
.conn-details[open] summary .chev { transform: rotate(180deg); }
.conn-details[open] summary { margin-bottom: 12px; }

/* profile picture editor — click the circle to upload, × to remove */
.avatar-edit { position: relative; width: 72px; height: 72px; }
.avatar-edit .pic { display: flex; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 1px solid var(--border); align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 22px; position: relative; }
.avatar-edit .pic img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit .pic .cam { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20,59,99,.55); color: #fff; opacity: 0; transition: .15s; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.avatar-edit .pic:hover .cam { opacity: 1; }
.avatar-edit .x { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--error); font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.avatar-edit .x:hover { border-color: var(--error); }

/* read-only field */
.ro { display: flex; flex-direction: column; gap: 4px; }
.ro .k { font-size: 12px; color: var(--text-subtle); font-weight: 500; }
.ro .v { font-size: 15px; }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.pager .pg-btns { display: flex; gap: 6px; }
.pg-num { width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.pg-num.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* progress chart (CSS bars) */
.chart { padding: 22px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; }
.chart-bars .bar { flex: 1; background: var(--primary-soft); border-radius: 4px 4px 0 0; position: relative; transition: .2s; }
.chart-bars .bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: var(--primary); border-radius: 0 0 0 0; opacity: .9; }
.chart-line { width: 100%; height: 200px; }

/* ---------------- modal ---------------- */
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,59,99,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: var(--r-modal); box-shadow: var(--el-modal); width: 480px; max-width: calc(100% - 48px); overflow: hidden; }
.modal.md { width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 24px 0; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 24px; }
.modal .x { cursor: pointer; color: var(--text-subtle); border: 0; background: transparent; padding: 4px; }
.modal .x:hover { color: var(--text); }

/* side panel (add user) */
.sidepanel-backdrop { position: absolute; inset: 0; background: rgba(20,59,99,.45); z-index: 100; }
.sidepanel { position: absolute; top: 0; right: 0; bottom: 0; width: 460px; background: #fff; box-shadow: var(--el-modal); z-index: 101; display: flex; flex-direction: column; }
.sidepanel-head { padding: 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidepanel-body { padding: 24px; overflow-y: auto; flex: 1; }
.sidepanel-foot { padding: 20px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; }

/* check option row */
.opt-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.opt-row .tickbox { width: 20px; height: 20px; }
.opt-row .tickbox svg { width: 13px; height: 13px; }

/* status dot inline */
.s-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.s-dot.green { background: var(--success); }
.s-dot.amber { background: var(--warning); }
.s-dot.red { background: var(--error); }
.s-dot.grey { background: var(--text-subtle); }
