/* GroupDesk "polish" layer: softer surfaces, clearer hierarchy and a friendlier phone layout.
   Loaded last (after fresh.css); remove this one <link> to go back to the previous look. */
:root { --radius: 18px; --line: #e6e9e7; --bg: #f3f5f4;
  --shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 6px 20px rgba(16, 24, 20, .05);
  --shadow-hi: 0 2px 6px rgba(16, 24, 20, .06), 0 14px 34px rgba(16, 24, 20, .10);
  --brand-grad: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 70%, #1b9b7a) 100%); }
body { background: radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 60%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; }

/* ---------- top bar ---------- */
.topbar { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .06); min-height: 60px; }
.topbar .org { font-weight: 600; }
.topbar .org select { min-height: 40px; width: auto; max-width: 100%; border-radius: 999px; padding: .3rem 2rem .3rem .9rem; background-color: var(--brand-2); border-color: transparent; font-weight: 600; }
.top-actions { margin-left: auto; display: flex; gap: .4rem; }
.top-actions .btn { border-radius: 999px; min-height: 38px; }

/* ---------- cards ---------- */
.card { border: 1px solid rgba(0, 0, 0, .05); box-shadow: var(--shadow); }
a.card:hover, .kpis .card:hover { box-shadow: var(--shadow-hi); }
.card h3 { font-size: 1.02rem; letter-spacing: -.01em; }
.page-head { margin-bottom: 1.3rem; }
.page-head h1 { font-weight: 750; letter-spacing: -.025em; }

/* KPI tiles: a coloured strip and number that stands out */
.kpis .card { position: relative; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.kpis .card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand); opacity: .85; }
.kpis .card:nth-child(2)::before { background: #1f9d55; } .kpis .card:nth-child(3)::before { background: #e5484d; } .kpis .card:nth-child(4)::before { background: var(--accent); }
.kpis .card:hover { transform: translateY(-2px); }
.kpi-label { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem !important; font-weight: 700; }
.kpi-val { font-weight: 750; }

/* month collection hero */
.progress.card { background: var(--brand-grad); position: relative; overflow: hidden; box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 30%, transparent); }
.progress.card::after { content: ''; position: absolute; width: 260px; height: 260px; right: -70px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.progress.card .row-between span { font-size: 2rem; letter-spacing: -.02em; }
.progress .bar { height: 14px; border-radius: 99px; }

/* dashboard quick actions as tiles */
.quick.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.quick.tiles > .btn { justify-content: flex-start; min-height: 52px; border-radius: 14px; white-space: normal; text-align: left; line-height: 1.2; }
.quick.tiles > .btn:not(.primary) { background: #f7f9f8; border-color: transparent; }
.quick.tiles > .btn:not(.primary):hover { background: var(--brand-2); }
.notice-bar { display: block; background: #fff8e6; border-color: #f4e2b0; color: #6b4500; }

/* ---------- buttons, fields ---------- */
.btn { transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--brand-grad); border-color: transparent; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost:hover { background: rgba(0, 0, 0, .04); }
.btn.wa { box-shadow: 0 4px 12px rgba(31, 157, 85, .25); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { border-color: #d9dfdc; background-color: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
input[type=search] { padding-left: 2.4rem !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238a948f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat .8rem center; }

/* ---------- tables ---------- */
.tbl th { background: #f7f9f8; color: #6f7a75; border-bottom: 1px solid var(--line); }
.tbl th:first-child { border-top-left-radius: 10px; } .tbl th:last-child { border-top-right-radius: 10px; }
.tbl tbody tr { transition: background-color .12s; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--brand) 4%, #fff); }
.tbl td a:not(.btn) { font-weight: 600; }
.pill { border-radius: 999px; font-weight: 600; }

/* member filters panel */
#mf { background: #f8faf9; border: 1px dashed #d5ddd9; border-radius: 16px; padding: .9rem 1rem; }
[data-mf-bloodsel] { font-weight: 600; }

/* modals */
.modal { box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.modal-backdrop, .modal-wrap { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* ---------- laptop ---------- */
@media (min-width: 861px) {
  .shell { grid-template-columns: 248px 1fr; }
  .sidenav { background: var(--brand-grad); position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; scrollbar-width: thin; padding: 1rem .75rem 1.5rem; }
  .sidenav a { gap: .75rem; font-weight: 550; color: rgba(255, 255, 255, .92); }
  .sidenav a span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-size: 1rem; flex-shrink: 0; }
  .sidenav a.active, .sidenav a.active:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
  .sidenav a.active span { background: var(--brand-2); }
  .content { max-width: 1280px; padding: 2rem 2.4rem 4rem; }
  .kpi-val { font-size: 1.75rem; }
}

/* ---------- phone ---------- */
@media (max-width: 860px) {
  body { background-attachment: scroll; }
  .topbar { padding: .5rem .8rem; row-gap: .3rem; min-height: 0; }
  .topbar .brand-name small { display: none; }
  .top-actions .btn { min-height: 36px; padding: .25rem .7rem; font-size: .8rem; }
  .topbar .org { font-size: .85rem; color: var(--muted); }
  .content { padding: 1rem .85rem 7.5rem; }
  .page-head { margin-bottom: 1rem; }
  .page-head h1 { font-size: 1.5rem; }
  .card { padding: 1rem; border-radius: 16px; }
  .kpis { gap: .65rem; }
  .kpis .card { padding: .85rem .9rem; }
  .kpi-val { font-size: 1.25rem; }
  .kpi-sub { font-size: .75rem !important; }
  .progress.card { padding: 1.1rem 1.15rem; }
  .progress.card .row-between span { font-size: 1.6rem; }
  .quick.tiles { grid-template-columns: 1fr 1fr; }
  .quick.tiles > .btn.primary { grid-column: 1 / -1; justify-content: center; min-height: 56px; font-size: 1.05rem; }

  /* frosted bottom bar with a floating pill for the current page */
  .sidenav { background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
    border-top: 1px solid rgba(0, 0, 0, .06); scrollbar-width: none; scroll-snap-type: x proximity; padding-left: .4rem; padding-right: .4rem;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%); }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a { scroll-snap-align: center; min-width: 70px; font-weight: 600; letter-spacing: -.01em; }
  .sidenav a span { display: inline-grid; place-items: center; width: 42px; height: 30px; border-radius: 999px; font-size: 1.2rem; transition: background-color .2s; }
  .sidenav a.active { background: none; }
  .sidenav a.active span { background: var(--brand-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 20%, transparent); }

  /* phone tables-as-cards: each row a soft card */
  .tbl.stack tr { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .55rem; }
  .tbl.stack tr:last-child { border-bottom: 1px solid var(--line); }
  .card:has(> .tbl-wrap > .tbl.stack), .card:has(> .tbl.stack) { background: transparent; border: 0; box-shadow: none; padding: 0; }
  .tbl tbody tr:hover td { background: none; }
  .toolbar { gap: .5rem; } .toolbar > * { flex: 1 1 140px; } .toolbar input[type=search] { flex-basis: 100%; }
  #mf { padding: .8rem; }
  [data-mf-bloodsel] { width: 100%; }
  #mf label.field { min-width: 0 !important; flex: 1 1 100%; }
}
/* ---------- simpler menu (fewer items), icon buttons, tools card ---------- */
.phone-only { display: none !important; }
.top-actions .icon-only { min-width: 38px; padding: .25rem .5rem; justify-content: center; font-size: 1.05rem; }
.quick.tiles.tools > .btn { background: #fff; border: 1px solid var(--line); font-weight: 600; }
.quick.tiles.tools > .btn:hover { background: var(--brand-2); }
@media (max-width: 860px) {
  .phone-only { display: inline-flex !important; }
  /* bottom bar: the five most used pages, equal width, no sideways scrolling */
  .sidenav { overflow-x: hidden; -webkit-mask-image: none; mask-image: none; justify-content: space-around; gap: 2px; padding-left: .25rem; padding-right: .25rem; }
  .sidenav a[data-r="dues"], .sidenav a[data-r="reports"], .sidenav a[data-r="settings"] { display: none; }
  .sidenav a { flex: 1 1 0; min-width: 0; padding: .3rem .1rem; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar { flex-wrap: nowrap; }
  .topbar .org { order: 0; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
  .topbar .brand-name { display: none; }
  .top-actions { gap: .25rem; flex-shrink: 0; }
  .top-actions .btn { padding: .2rem .55rem; min-height: 34px; }
  .page-head { gap: .5rem; }
  .page-head h1 { font-size: 1.35rem; }
  .page-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
  .page-actions .btn { min-height: 44px; }
  .quick.tiles.tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick.tiles.tools > .btn { flex-direction: column; justify-content: center; text-align: center; font-size: .78rem; min-height: 68px; gap: .2rem; }
  .card h3 { margin-bottom: .55rem; }
  .grid2.gap { gap: .75rem; }
}
@media print { body { background: #fff; } .progress.card::after { display: none; } .card { box-shadow: none; } }
