﻿/* =====================================================================
   Abi Seifein admin theme — Bootstrap 5.3 (RTL) custom layer
   Load order: bootstrap.rtl.min.css → bootstrap-icons → this file.
   Brand colour and fonts are set once here as tokens; pages use Bootstrap
   classes (card, row/col, form-control, btn-primary, table) plus the few
   app-* classes below.
   ===================================================================== */

/* ---------- Fonts ----------
   Main: Droid Arabic Kufi (Content/font, © Google, Apache 2.0) — the face the old theme used. Only a Regular
   weight exists, so bold text is synthesized by the browser.
   Fallback: IBM Plex Sans Arabic (self-hosted, OFL), used only if the main font can't load. */
@font-face { font-family: "Droid Arabic Kufi"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../font/DroidKufi-Regular.woff2") format("woff2"), url("../font/DroidKufi-Regular.woff") format("woff"); }

@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../lib/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  /* Brand blue (kept from the old theme, deepened for contrast) */
  --app-brand: #1a62b3;
  --app-brand-rgb: 26, 98, 179;
  --app-brand-hover: #154f91;
  --app-brand-soft: #e8f0fa;
  --app-ink: #1c2733;
  --app-muted: #5d6b7a;
  --app-surface: #ffffff;
  --app-canvas: #f3f6fa;
  --app-line: #e1e7ee;
  --app-sidebar: #0f2b4a;
  --app-sidebar-ink: #c5d4e6;
  --app-sidebar-active: #ffffff;
  --app-sidebar-width: 16.5rem;
  --app-radius: .625rem;

  /* Bootstrap overrides */
  --bs-primary: var(--app-brand);
  --bs-primary-rgb: var(--app-brand-rgb);
  --bs-link-color: var(--app-brand);
  --bs-link-color-rgb: var(--app-brand-rgb);
  --bs-link-hover-color: var(--app-brand-hover);
  --bs-body-font-family: "Droid Arabic Kufi", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --bs-body-color: var(--app-ink);
  --bs-body-bg: var(--app-surface);   /* Bootstrap uses this for inputs/cards too; the page canvas is set on body */
  --bs-border-color: var(--app-line);
  --bs-border-radius: var(--app-radius);
  --bs-secondary-color: var(--app-muted);
  --bs-focus-ring-color: rgba(var(--app-brand-rgb), .3);
}

/* Base text size: the browser default (normally 16px). Bootstrap sizes inputs, buttons and headings in rem,
   so to make all text larger or smaller change it here, e.g. calc(100% + 1pt); spacing scales with it. */
html { font-size: 100%; }

body {
  background-color: var(--app-canvas);
  font-size: .95rem;
}

.btn-primary {
  --bs-btn-bg: var(--app-brand);
  --bs-btn-border-color: var(--app-brand);
  --bs-btn-hover-bg: var(--app-brand-hover);
  --bs-btn-hover-border-color: var(--app-brand-hover);
  --bs-btn-active-bg: var(--app-brand-hover);
  --bs-btn-active-border-color: var(--app-brand-hover);
  --bs-btn-disabled-bg: var(--app-brand);
  --bs-btn-disabled-border-color: var(--app-brand);
}
.btn-outline-primary {
  --bs-btn-color: var(--app-brand);
  --bs-btn-border-color: var(--app-brand);
  --bs-btn-hover-bg: var(--app-brand);
  --bs-btn-hover-border-color: var(--app-brand);
  --bs-btn-active-bg: var(--app-brand-hover);
}
.form-control:focus, .form-select:focus {
  border-color: rgba(var(--app-brand-rgb), .55);
  box-shadow: 0 0 0 .2rem rgba(var(--app-brand-rgb), .18);
}

/* ---------- Layout: sidebar (right in RTL) + main ---------- */
.app-skip {
  position: absolute; inset-inline-start: 1rem; inset-block-start: -3rem; z-index: 2000;
}
.app-skip:focus { inset-block-start: .75rem; }

.app-sidebar {
  --bs-offcanvas-width: var(--app-sidebar-width);
  --bs-offcanvas-bg: var(--app-sidebar);
  --bs-offcanvas-color: var(--app-sidebar-ink);
  background: var(--app-sidebar);
  color: var(--app-sidebar-ink);
  /* The slide-in panel on phones has no .offcanvas-body, so it must scroll itself, or the items below the
     screen (حسابي, تسجيل الخروج) can't be reached */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.app-sidebar > * { flex-shrink: 0; }
@media (min-width: 992px) {
  .app-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0;
    inline-size: var(--app-sidebar-width);
    overflow-y: auto;
    /* Bootstrap's .offcanvas-lg sets background-color: transparent !important at this breakpoint */
    background-color: var(--app-sidebar) !important;
  }
  .app-main { margin-inline-start: var(--app-sidebar-width); }
}

.app-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff; text-decoration: none;
}
.app-brand-mark {
  display: grid; place-items: center;
  inline-size: 2.5rem; block-size: 2.5rem; border-radius: .6rem;
  background: var(--app-brand); color: #fff; font-size: 1.25rem;
}
.app-brand-text { line-height: 1.3; font-weight: 600; font-size: .95rem; }
.app-brand-text small { display: block; font-weight: 400; color: var(--app-sidebar-ink); font-size: .78rem; }

.app-user {
  display: flex; align-items: center; gap: .75rem;
  margin: 0 1rem 1rem; padding: .75rem;
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, .06);
}
.app-user img {
  inline-size: 2.75rem; block-size: 2.75rem; border-radius: 50%;
  object-fit: cover; background: rgba(255, 255, 255, .15);
}
.app-user-name { color: #fff; font-weight: 500; font-size: .9rem; line-height: 1.3; }
.app-user-role { font-size: .75rem; color: var(--app-sidebar-ink); }

.app-nav { list-style: none; margin: 0; padding: 0 .75rem 1.5rem; }
.app-nav-label {
  padding: 1rem .75rem .4rem; font-size: .72rem; font-weight: 600;
  letter-spacing: .02em; color: rgba(197, 212, 230, .65);
}
/* Group title = fold/unfold button for its items */
.app-nav-group { list-style: none; }
.app-nav-sub { list-style: none; margin: 0; padding: 0; }
.app-nav .app-nav-toggle {
  display: flex; align-items: center; gap: .5rem; inline-size: 100%;
  border: 0; border-radius: .5rem; background: transparent; text-align: start; cursor: pointer;
}
.app-nav .app-nav-toggle:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.app-nav .app-nav-toggle:focus-visible { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: -2px; }
.app-nav .app-nav-chevron { margin-inline-start: auto; font-size: .75rem; transition: transform .2s; }
.app-nav .app-nav-toggle.collapsed .app-nav-chevron { transform: rotate(90deg); } /* closed: points left (RTL) */
@media (prefers-reduced-motion: reduce) { .app-nav .app-nav-chevron { transition: none; } }
.app-nav a, .app-nav .app-nav-btn {
  display: flex; align-items: center; gap: .7rem;
  inline-size: 100%;
  padding: .55rem .75rem; margin-block: .1rem;
  border: 0; border-radius: .5rem;
  background: transparent; color: var(--app-sidebar-ink);
  text-decoration: none; text-align: start; font-size: .92rem;
}
.app-nav a:hover, .app-nav .app-nav-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.app-nav a[aria-current="page"] {
  background: var(--app-brand); color: var(--app-sidebar-active); font-weight: 500;
}
.app-nav i { font-size: 1.05rem; opacity: .9; }

/* ---------- Top bar ---------- */
.app-topbar {
  position: sticky; inset-block-start: 0; z-index: 1020;
  display: flex; align-items: center; gap: .75rem;
  min-block-size: 3.75rem; padding: .5rem 1.25rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(8px);
  border-block-end: 1px solid var(--app-line);
}
.app-topbar-title { margin: 0; font-size: 1.1rem; font-weight: 600; }
.app-content { padding: 1.5rem 1.25rem 2.5rem; }
@media (min-width: 1200px) { .app-content { padding-inline: 2rem; } }
.app-footer { padding: 1rem 1.25rem 1.5rem; color: var(--app-muted); font-size: .8rem; }

/* ---------- Cards ---------- */
.card {
  --bs-card-bg: var(--app-surface);
  --bs-card-border-color: var(--app-line);
  --bs-card-cap-bg: transparent;
  --bs-card-border-radius: var(--app-radius);
  box-shadow: 0 1px 2px rgba(16, 38, 64, .04), 0 2px 8px rgba(16, 38, 64, .04);
}
.card + .card { margin-block-start: 1.25rem; }
.card-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  padding-block: .85rem;
}
.card-title { margin: 0; font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.card-title i { color: var(--app-brand); }
.form-label { font-weight: 500; font-size: .88rem; margin-block-end: .35rem; }

/* asp:CheckBox renders <span class="…"><input/></span>; let the input sit directly in .form-check
   so Bootstrap's checkbox/switch layout applies (pair with form-check-input on the input, set in page script). */
.form-check > .app-switch { display: contents; }

/* ASP.NET validators */
.validation, .field-error { color: var(--bs-danger); font-size: .82rem; font-weight: 500; }

/* ---------- Data table (GridView) ---------- */
.app-table-wrap {
  overflow: auto;
  max-block-size: min(70vh, 48rem);
  container-type: inline-size;
  border-block-start: 1px solid var(--app-line);
}
.app-table { margin: 0; --bs-table-bg: var(--app-surface); }
.app-table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.app-table thead th {
  position: sticky; inset-block-start: 0; z-index: 1;
  background: #f7f9fc; color: var(--app-muted);
  font-size: .8rem; font-weight: 600; white-space: nowrap;
  border-block-end: 1px solid var(--app-line);
}
.app-table tbody tr:hover > * { --bs-table-bg-state: rgba(var(--app-brand-rgb), .04); }
/* A column to draw the eye to (e.g. last call date) — replaces the old yellow cell background */
.app-table td.app-cell-highlight { --bs-table-bg: #fff8e1; }
.app-table .app-sub { display: block; margin-block-start: .2rem; color: var(--bs-danger); font-size: .78rem; }
.app-table .app-sub b { color: var(--bs-success) !important; }

/* Member call status: a stripe on the row's leading edge + a light tint.
   --status is set per row by the page (validated #RRGGBB). */
.app-table tbody tr[style*="--status"] > td:first-child { box-shadow: inset -5px 0 0 var(--status); }
.app-table tbody tr[style*="--status"] > * { --bs-table-bg: color-mix(in srgb, var(--status) 16%, white); }
/* Rows ticked for a bulk action */
.app-table tbody tr.row-selected > * { --bs-table-bg: #dbeafe; }

/* GridView pager (renders as a nested table) */
.app-pager td { padding: .75rem !important; background: var(--app-surface) !important; border: 0; }
.app-pager table { margin-inline: auto; }
.app-pager table td { padding: 0 .15rem !important; }
.app-pager a, .app-pager span {
  display: inline-block; min-inline-size: 2.1rem; padding: .3rem .55rem;
  border: 1px solid var(--app-line); border-radius: .45rem;
  text-align: center; text-decoration: none; font-size: .85rem;
}
.app-pager span { background: var(--app-brand); border-color: var(--app-brand); color: #fff; }
.app-pager a:hover { background: var(--app-brand-soft); }

/* Narrow container: each row becomes a card; labels come from the column headers
   (theme.js copies each header into --label on its cells). */
@container (width < 640px) {
  .app-table, .app-table thead, .app-table tbody, .app-table tr, .app-table th, .app-table td { display: block; }
  .app-table thead { display: none; }
  .app-table tbody tr {
    margin: .75rem; border: 1px solid var(--app-line); border-radius: var(--app-radius); overflow: hidden;
  }
  .app-table tbody tr.app-pager { border: 0; }
  .app-table tbody td { border: 0; padding: .4rem .85rem; }
  .app-table tbody td[style*="--label"]::before {
    content: var(--label) ": " / var(--label);
    display: inline-block; min-inline-size: 7rem; color: var(--app-muted); font-size: .8rem; font-weight: 600;
  }
  .app-table tbody tr[style*="--status"] > td:first-child { box-shadow: inset 0 4px 0 var(--status); }
  /* Pager (tfoot, or tbody on older grids): the rules above would stack its nested page-number table one
     number per line; lay the numbers out as one centred, wrapping row instead. */
  .app-table tfoot { display: block; }
  .app-table tr.app-pager, .app-table tr.app-pager > td { display: block; border: 0; margin: 0; }
  .app-table tr.app-pager > td::before { display: none; }
  .app-table .app-pager table, .app-table .app-pager table tbody { display: block; inline-size: auto; }
  .app-table .app-pager table tr {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem;
    margin: 0; border: 0; border-radius: 0; overflow: visible;
  }
  .app-table .app-pager table td { display: block; padding: 0 !important; }
  .app-table .app-pager table td::before { display: none; }
  .app-pager a, .app-pager span { min-inline-size: 2.5rem; padding-block: .45rem; }
}

/* Phones: lists grow with the page instead of scrolling inside their own box (a scroll inside a scroll),
   and search cards marked data-mobile-collapse can fold to their header (theme.js collapsibleCards). */
@media (max-width: 767.98px) {
  .app-table-wrap { max-block-size: none; }
  .card.app-collapsed > :not(.card-header) { display: none; }
  .card.app-collapsed > .card-header { border-block-end: 0; }
}

/* "Report ready" bar (theme.js openReport) when the browser blocked the report tab */
.app-report-ready {
  position: fixed; z-index: 1090; inset-block-end: 1rem; inset-inline: 1rem; margin: 0;
  max-inline-size: 28rem; margin-inline-start: auto;
}

/* ---------- Iframe modal (member details, call history, attendance) ---------- */
.app-frame-modal .modal-body { padding: 0; }
.app-frame-modal iframe { display: block; inline-size: 100%; block-size: min(75vh, 46rem); border: 0; }
/* Below 768px the modal is full-screen (modal-fullscreen-md-down): let the frame fill it under the header */
@media (max-width: 767.98px) {
  .app-frame-modal iframe { block-size: calc(100vh - 3.6rem); block-size: calc(100dvh - 3.6rem); }
}

.app-avatar-sm {
  flex: none; inline-size: 2.25rem; block-size: 2.25rem; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--app-line); background: var(--app-canvas);
}
.app-avatar-lg {
  inline-size: 5rem; block-size: 5rem; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--app-line); background: var(--app-canvas);
}

/* ---------- Dashboard ---------- */
/* Stat tile: label · value · note. Text stays in ink colours; only the icon (and the thin edge on
   "attention" tiles) carries status, so meaning never depends on colour alone. */
.app-stat {
  block-size: 100%; padding: 1rem 1.1rem;
  background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius);
  box-shadow: 0 1px 2px rgba(16, 38, 64, .04);
}
.app-stat-label { display: flex; align-items: center; gap: .45rem; color: var(--app-muted); font-size: .85rem; font-weight: 500; }
.app-stat-label i { font-size: 1.05rem; color: var(--app-brand); }
.app-stat-value { margin-block: .35rem .15rem; font-size: 1.9rem; font-weight: 600; line-height: 1.1; color: var(--app-ink); }
.app-stat-note { color: var(--app-muted); font-size: .8rem; }
.app-stat-attention { border-inline-start: 4px solid #d97706; }
/* A stat tile that opens something (e.g. the birthdays popup) */
a.app-stat-link { color: inherit; text-decoration: none; border-inline-start: 4px solid #db2777; transition: border-color .15s, box-shadow .15s; }
a.app-stat-link .app-stat-label i:first-child { color: #db2777; }
a.app-stat-link:hover, a.app-stat-link:focus-visible { border-color: rgba(var(--app-brand-rgb), .45); border-inline-start-color: #db2777; box-shadow: 0 6px 18px rgba(16, 38, 64, .08); }
.app-stat-attention .app-stat-label i { color: #b45309; }

.app-section-title { font-size: .9rem; font-weight: 600; color: var(--app-muted); margin-block-end: .75rem; }
.app-tile {
  display: flex; align-items: center; gap: .85rem; block-size: 100%;
  padding: 1rem 1.1rem; border: 1px solid var(--app-line); border-radius: var(--app-radius);
  background: var(--app-surface); color: var(--app-ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 38, 64, .04);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.app-tile:hover, .app-tile:focus-visible {
  border-color: rgba(var(--app-brand-rgb), .45); color: var(--app-ink);
  box-shadow: 0 6px 18px rgba(16, 38, 64, .08); transform: translateY(-1px);
}
.app-tile-icon {
  flex: none; display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem;
  border-radius: .6rem; background: var(--app-brand-soft); color: var(--app-brand); font-size: 1.3rem;
}
.app-tile-text { font-weight: 500; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { .app-tile { transition: none; } .app-tile:hover { transform: none; } }

/* Dashboard filter bar: on phones the title takes its own line and the two filters share the next one */
@media (max-width: 575.98px) {
  .app-dash-head > :first-child { flex: 1 0 100%; }
  .app-dash-head > :not(:first-child) { flex: 1 1 0; min-inline-size: 0; }
  .app-stat { padding: .8rem .85rem; }
  .app-stat-label { font-size: .8rem; }
  .app-stat-value { font-size: 1.6rem; }
  .app-stat-note { font-size: .75rem; }
  /* Shortcut tiles: icon above the text so two tiles fit side by side without breaking every word */
  .app-tile { flex-direction: column; justify-content: center; gap: .5rem; padding: .85rem .5rem; text-align: center; }
}

/* Dashboard lists (top 10 only): no inner scroll box, and on narrow screens a compact row instead of the
   generic one-label-per-line card: name + phone / "last date · since" / buttons. */
.app-dash-wrap { max-block-size: none; }
/* Birthdays already past this month */
.app-table tbody tr.app-row-past > * { color: var(--app-muted); }
/* Latest call note under a member's name (dashboard lists): two lines at most, full text in the tooltip */
.app-last-note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  margin-block-start: .3rem; max-inline-size: 32rem; font-size: .8rem; line-height: 1.5; color: var(--app-muted); white-space: normal;
}
.app-last-note .bi { color: var(--app-brand); }
.app-last-note .app-note-date { font-weight: 600; }
@container (width < 640px) {
  .app-table.app-dash-list tbody tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem;
    margin: .5rem .75rem; padding: .7rem .85rem;
  }
  .app-table.app-dash-list tbody td { padding: 0; background: transparent; box-shadow: none; }
  .app-table.app-dash-list tbody tr:hover { background: rgba(var(--app-brand-rgb), .04); }
  .app-table.app-dash-list tbody td:first-child { flex: 1 0 100%; }
  .app-table.app-dash-list tbody td:first-child::before,
  .app-table.app-dash-list tbody td:last-child::before { display: none; }
  .app-table.app-dash-list tbody td:nth-child(2),
  .app-table.app-dash-list tbody td:nth-child(3) { font-size: .85rem; }
  .app-table.app-dash-list tbody td:nth-child(2)::before { min-inline-size: 0; margin-inline-end: .25rem; }
  .app-table.app-dash-list tbody td:nth-child(3)::before { content: "·"; min-inline-size: 0; margin-inline-end: .5rem; }
  .app-table.app-dash-list tbody td:last-child { flex: 1 0 100%; margin-block-start: .35rem; }
  .app-table.app-dash-list tbody td[colspan] { flex: 1 0 100%; padding: 1rem 0; }
}

/* ---------- Framed pages (Frame.master, shown inside the modal) ---------- */
body.app-frame { background-color: var(--app-surface); }
.app-frame main { padding: 1rem; }
.app-frame .card { box-shadow: none; }

/* Label / value list (member details) */
.app-details { margin: 0; }
.app-details > div {
  display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: .25rem 1rem;
  padding-block: .6rem; border-block-end: 1px solid var(--app-line);
}
.app-details > div:last-child { border-block-end: 0; }
.app-details dt { color: var(--app-muted); font-weight: 500; font-size: .88rem; }
.app-details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@container (width < 420px) { .app-details > div { grid-template-columns: 1fr; } }
.app-details-wrap { container-type: inline-size; }

/* ---------- Loading overlay (UpdatePanel postbacks; ids used by loading.js) ---------- */
#dv_overlay {
  display: none; position: fixed; inset: 0; z-index: 2050;
  background: rgba(15, 43, 74, .18);
}
#dv_loading {
  display: none; position: fixed; z-index: 2051;
  inset-block-start: 1rem; inset-inline-start: 50%; translate: 50% 0;
  padding: .55rem 1rem; border-radius: 2rem;
  background: var(--app-surface); color: var(--app-ink);
  box-shadow: 0 6px 24px rgba(16, 38, 64, .18); font-size: .9rem;
}

/* ---------- Autocomplete list (App.autocomplete in theme.js) ---------- */
.app-ac-list {
  inset-block-start: 100%; inset-inline-start: 0;
  inline-size: 100%; max-block-size: 18rem; overflow-y: auto;
  margin-block-start: .25rem;
}
.app-ac-list .dropdown-item { white-space: normal; cursor: pointer; }
.app-ac-list .dropdown-item.active { background: var(--app-brand); color: #fff; }

/* ---------- Select2 / flatpickr alignment with Bootstrap ---------- */
.select2-container--bootstrap-5 .select2-selection { min-block-size: calc(1.5em + .75rem + 2px); }
.flatpickr-calendar { font-family: var(--bs-body-font-family); }

/* ---------- Login ---------- */
.app-login {
  min-block-size: 100vh;
  display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(var(--app-brand-rgb), .22), transparent 60%),
    linear-gradient(180deg, #0f2b4a 0%, #163d68 100%);
}
.app-login-card { inline-size: min(100%, 26rem); border: 0; box-shadow: 0 20px 60px rgba(4, 18, 36, .35); }
.app-login-card .card-body { padding: 2rem; }
.app-login-logo { display: block; max-inline-size: 7rem; margin: 0 auto 1rem; }
.app-login-title { text-align: center; font-size: 1.05rem; font-weight: 600; margin-block-end: .25rem; }
.app-login-sub { text-align: center; color: var(--app-muted); font-size: .85rem; margin-block-end: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
