/* ArtGM.online — shared stylesheet. Version: see version.txt (appended to the URL as ?v=). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
:root {
  --bg:#f7f5f0; --surface:#fff; --border:#ddd9d0; --border-light:#eeebe4;
  --text:#2a2a2a; --text-muted:#6a6a6a;
  --accent:#8b6914; --accent-dark:#6a4f0e; --accent-light:#f5edd8; --accent-line:#d4ad50; --on-accent:#fff;
  /* Gold accent defaults. A gallery's brand colour re-points these (includes/header.php, brandAccentCss()). */
  --nav-bg:#1a1a1a; --nav-text:#ede9e0; --nav-hover:#8b6914;
  /* Nav theme tokens. Defaults = the dark nav. .nav-custom (below) re-points them for a custom bar colour;
     header.php supplies the values. */
  --nav-hover-text:#fff; --nav-brand:#e8c96a; --nav-brand-hover:#f0d87a; --nav-brand-line:#3a3a3a;
  --nav-logout:#999; --nav-logout-line:#444;
  --nav-menu-bg:#252525; --nav-menu-line:#333; --nav-menu-divider:#2e2e2e;
  --nav-m-line:#2a2a2a; --nav-m-menu-bg:#1e1e1e; --nav-m-menu-divider:#1a1a1a;
  --nav-shadow:0 2px 6px rgba(0,0,0,.3);
  --green:#2d6a2d; --green-bg:#eaf4ea; --red:#c0392b; --red-bg:#fdf0ee;
  --orange:#a35900; --orange-bg:#fff4e5; --blue:#1a5276; --blue-bg:#eaf2fb; /* orange darkened for >=4.5:1 text contrast on --orange-bg */
  --th-bg:#f0ede5; --row-hover:#faf8f4; --btn-secondary-hover:#ccc9c0; --green-dark:#1d4a1d;
  --radius:6px; --shadow:0 2px 8px rgba(0,0,0,.08); --shadow-sm:0 1px 4px rgba(0,0,0,.06);
}
body { font-family:'Segoe UI',system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--text); font-size:15px; line-height:1.6; min-height:100vh; min-height:100dvh; /* dvh: iOS Safari's 100vh includes the collapsing URL bar */ display:flex; flex-direction:column; }
a { color:var(--accent); text-decoration:none; }
a:hover { color:var(--accent-dark); text-decoration:underline; }
/* Visible keyboard focus for every interactive element (inputs get their own ring below). */
:focus-visible { outline:2px solid var(--accent-line, #d4ad50); outline-offset:2px; }

.nav { background:var(--nav-bg); padding:0 24px; display:flex; align-items:center; position:sticky; top:0; z-index:100; box-shadow:var(--nav-shadow); }
.nav-brand { font-family:Georgia,serif; font-size:1.15rem; color:var(--nav-brand); padding:16px 24px 16px 0; margin-right:8px; border-right:1px solid var(--nav-brand-line); white-space:nowrap; text-decoration:none; }
.nav-brand:hover { color:var(--nav-brand-hover); text-decoration:none; }
.nav-links { display:flex; align-items:stretch; flex:1; }
/* Top-level nav items: plain links and the Modules dropdown toggle share one base. */
.nav-links a, .nav-dropdown-toggle { color:var(--nav-text); padding:0 16px; display:flex; align-items:center; font-size:.92rem; transition:background .15s,color .15s; text-decoration:none; height:52px; }
.nav-links a:hover, .nav-links a.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
.nav-right { margin-left:auto; display:flex; align-items:center; gap:12px; }
.nav-right a { color:var(--nav-text); font-size:.82rem; text-decoration:none; padding:6px 10px; border-radius:var(--radius); transition:background .15s,color .15s; }
.nav-right a:hover, .nav-right a.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
.nav-logo { max-height:40px; width:auto; display:block; }
.nav-logout { font-size:.8rem; color:var(--nav-logout) !important; border:1px solid var(--nav-logout-line); padding:5px 12px !important; border-radius:var(--radius); transition:background .15s,color .15s; }
.nav-logout:hover { background:var(--nav-hover); color:var(--nav-hover-text) !important; border-color:var(--nav-hover); }
.nav-toggle { display:none; background:none; border:none; cursor:pointer; padding:10px; margin-left:auto; flex-direction:column; justify-content:center; gap:5px; }
.nav-toggle span { display:block; width:22px; height:2px; background:var(--nav-text); border-radius:2px; transition:transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity:0; transform:scaleX(0); }
.nav-open .nav-toggle span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }
/* Modules dropdown */
.nav-dropdown { position:relative; display:flex; align-items:stretch; }
.nav-dropdown-toggle { gap:5px; cursor:pointer; } /* base: shared rule with .nav-links a above */
.nav-dropdown-toggle:hover, .nav-dropdown.open .nav-dropdown-toggle, .nav-dropdown-toggle.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
.nav-dropdown-arrow { font-size:.7rem; opacity:.75; }
.nav-dropdown-menu { display:none; position:absolute; top:100%; left:0; background:var(--nav-menu-bg); border:1px solid var(--nav-menu-line); border-top:none; min-width:180px; z-index:200; box-shadow:0 6px 18px rgba(0,0,0,.4); }
.nav-dropdown.open .nav-dropdown-menu { display:block; }
.nav-dropdown-menu a { display:block; color:var(--nav-text); padding:11px 18px; font-size:.87rem; text-decoration:none; border-bottom:1px solid var(--nav-menu-divider); white-space:nowrap; transition:background .12s,color .12s; }
.nav-dropdown-menu a:last-child { border-bottom:none; }
/* Add-on the gallery has no subscription for: muted, with a padlock; links to the Subscription page */
.nav-dropdown-menu a.nav-locked { opacity:.55; }
.nav-dropdown-menu a.nav-locked:hover { opacity:.85; }
.nav-lock-icon { margin-left:6px; vertical-align:-1px; }
/* Past-due notice under the nav bar (includes/nav.php) */
.past-due-banner { background:var(--orange-bg); color:var(--orange); border-bottom:1px solid var(--orange); padding:10px 24px; font-size:.88rem; text-align:center; }
.past-due-banner a { color:inherit; font-weight:600; text-decoration:underline; margin-left:6px; white-space:nowrap; }
.past-due-form { display:inline; margin:0; }
.past-due-form button { background:none; border:none; padding:0; margin-left:6px; font:inherit; font-weight:600; color:inherit; text-decoration:underline; cursor:pointer; white-space:nowrap; }
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
/* Settings dropdown in the right-hand nav group: small toggle matching the other right-hand links; menu opens right-aligned */
.nav-right .nav-dropdown { align-items:center; }
.nav-right .nav-dropdown-toggle { height:auto; padding:6px 10px; font-size:.82rem; border-radius:var(--radius); }
.nav-right .nav-dropdown-menu { top:calc(100% + 10px); left:auto; right:0; }
.nav-right .nav-dropdown-menu a { padding:11px 18px; font-size:.87rem; border-radius:0; }

/* Custom nav bar colour (Appearance > Branding > Nav bar colour). includes/header.php sets every --nav-* token
   for the chosen colour; only the shadow is fixed here. */
.nav-custom { --nav-shadow:0 1px 0 rgba(0,0,0,.12); }

.page-wrapper { max-width:1200px; margin:0 auto; padding:32px 24px 60px; flex:1; width:100%; }
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:28px; padding-bottom:16px; border-bottom:2px solid var(--border); gap:16px; flex-wrap:wrap; }
.page-title { font-family:Georgia,serif; font-size:1.7rem; font-weight:normal; }
.page-subtitle { font-size:.9rem; color:var(--text-muted); margin-top:2px; }

.btn { display:inline-flex; align-items:center; gap:6px; padding:9px 18px; border-radius:var(--radius); font-size:.88rem; font-weight:500; cursor:pointer; border:none; transition:background .15s; text-decoration:none; white-space:nowrap; }
.btn:hover { text-decoration:none; }
.btn-primary { background:var(--accent); color:var(--on-accent); }
.btn-primary:hover { background:var(--accent-dark); color:var(--on-accent); }
.btn-secondary { background:var(--border); color:var(--text); }
.btn-secondary:hover { background:var(--btn-secondary-hover); color:var(--text); }
.btn-danger { background:var(--red-bg); border:1px solid var(--red); color:var(--red); }
.btn-danger:hover { background:var(--red); border-color:var(--red); color:#fff; }
.btn-success { background:var(--green); color:#fff; }
.btn-success:hover { background:var(--green-dark); color:#fff; }
.btn-sm { padding:5px 12px; font-size:.82rem; }
.gd-ic { justify-content:center; width:30px; height:30px; padding:0; } /* icon-only button: pair with .btn, title + aria-label, and docIcon() */
.btn-outline { background:transparent; border:1px solid var(--accent); color:var(--accent); }
.btn-outline:hover { background:var(--accent); color:var(--on-accent); }

/* Shared "surface card" base — .card and .stat-card
   use the same background/border/radius/shadow; each below only adds
   its own padding/layout on top. */
.card, .stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.card { padding:24px; }
.card-title { font-family:Georgia,serif; font-size:1.05rem; font-weight:normal; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid var(--border-light); }
body.style-gold .card { overflow:hidden; }
body.style-gold .card-title { background:var(--accent-light); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); margin:-24px -24px 20px; padding:15px 24px; }
body.style-gold .detail-section:first-child h3 { background:var(--accent-light); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); margin:-24px -24px 12px; padding:10px 24px; }
body.style-gold .detail-section + .detail-section h3 { background:var(--accent-light); border-top:1px solid var(--accent-line); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); margin:0 -24px 12px; padding:10px 24px; }
body.style-gold .card-table-header { background:var(--accent-light); border-bottom:2px solid var(--accent-line); }
body.style-gold .card-table-header h2 { color:var(--accent-dark); }

.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:16px; margin-bottom:32px; }
.card-grid      { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:24px; }
.card-grid-2-1  { display:grid; grid-template-columns:2fr 1fr; gap:24px; }
/* Equal-width card columns (minmax(0,…) so wide content can't blow a column out); stack on narrower screens.
   .card-grid-2 = two across; .card-grid-3 = three across, two under 1000px. */
.card-grid-2, .card-grid-3 { display:grid; gap:24px; align-items:start; grid-template-columns:repeat(2, minmax(0, 1fr)); }
.card-grid-3 { grid-template-columns:repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .card-grid-3 { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .card-grid-2 { grid-template-columns:minmax(0, 1fr); } }
@media (max-width: 640px)  { .card-grid-3 { grid-template-columns:minmax(0, 1fr); } }

/* The app's one chevron for anything that opens and closes: <span class="chev" aria-hidden="true"></span>.
   Points right when closed and turns down when open: inside an open <details>, inside an open .nav-dropdown, inside a
   button with aria-expanded="true", or when it carries .is-open. Colour and size come from the parent (set font-size
   and color on the span or its container). The table-row version (.chevron-btn below) uses the same glyph. */
.chev { display:inline-block; font-size:.8rem; line-height:1; flex-shrink:0; transition:transform .2s; }
.chev::before { content:"\276F"; }
details[open] > summary .chev, .nav-dropdown.open .chev, [aria-expanded="true"] .chev, .chev.is-open { transform:rotate(90deg); }

/* Expand/collapse chevron on table rows + the panel that opens under the row (Users settings) */
.chevron-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:.9rem; padding:4px 8px; border-radius:var(--radius); transition:color .15s, transform .2s; display:inline-block; transform:rotate(0deg); }
.chevron-btn:hover { color:var(--accent); }
.chevron-btn.open  { transform:rotate(90deg); color:var(--accent); }
.staff-expand-row td { background:#faf8f4; border-bottom:2px solid var(--border); }
.staff-panel { padding:18px 20px; }
.staff-panel-fields { display:flex; flex-wrap:wrap; gap:14px 20px; margin-bottom:16px; }
.sp-field { display:flex; flex-direction:column; gap:4px; }
.sp-field label { font-size:.82rem; font-weight:500; color:var(--text-muted); }
.sp-field input[type="text"], .sp-field input[type="email"], .sp-field select { padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius); font-size:.88rem; font-family:inherit; background:#fff; min-width:180px; }
.sp-field input:focus, .sp-field select:focus { outline:none; border-color:var(--accent-line, #d4ad50); box-shadow:0 0 0 3px var(--accent-light, rgba(139,105,20,.12)); }
.sp-field-check { justify-content:flex-end; }
.sp-field-check label { display:flex; align-items:center; gap:6px; font-size:.88rem; cursor:pointer; }
.staff-panel-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* A checkbox/radio label that should read as normal text, not the muted field label.
   label.check-label (not just .check-label) so it also beats `.sp-field label`. */
label.check-label { font-weight:normal; font-size:.88rem; color:var(--text); cursor:pointer; }

/* One-time-code box (authenticator / recovery code): wide-spaced digits */
.code-input { letter-spacing:.2em; font-size:1.2rem; }
.stat-card { padding:20px; text-align:center; border-top:3px solid var(--accent); }
/* Shared with .stat-card-v's vertical variant below — only font-size/margin differ per layout. */
.stat-value, .stat-card-v .stat-value { font-family:Georgia,serif; color:var(--accent); font-weight:normal; line-height:1; }
.stat-label, .stat-card-v .stat-label { color:var(--text-muted); }
.stat-value { font-size:2rem; margin-bottom:6px; }
.stat-label { font-size:.85rem; }

.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:.9rem; }
thead th { text-align:left; padding:10px 14px; background:var(--th-bg); border-bottom:2px solid var(--border); font-weight:500; font-size:.85rem; color:var(--text-muted); white-space:nowrap; }
tbody tr { border-bottom:1px solid var(--border-light); }
tbody tr:last-child { border-bottom:none; }
tbody tr:hover { background:var(--row-hover); }
tbody td { padding:11px 14px; vertical-align:middle; }
.td-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.td-actions-nowrap { flex-wrap:nowrap; } /* icon-only actions: keep on one row, the column grows to fit */

thead th.sortable a { display:inline-flex; align-items:center; gap:3px; color:inherit; text-decoration:none; }
thead th.sortable a:hover { color:var(--accent-dark); text-decoration:none; }
thead th.sortable .arrow { font-size:.7rem; color:var(--accent); }
thead th.sort-active { color:var(--accent-dark); background:var(--accent-light); }


.badge { display:inline-block; padding:3px 9px; border-radius:var(--radius); font-size:.78rem; font-weight:500; }
/* Colour-named badges (.badge-green etc.) are aliases for the status-named
   ones — same look, used when the badge isn't about artwork/sale status,
   so the class name matches what it actually looks like. */
.badge-available, .badge-sold, .badge-green  { background:var(--green-bg);  color:var(--green); }
.badge-red                      { background:var(--red-bg);    color:var(--red); }
.badge-reserved,  .badge-amber  { background:var(--orange-bg); color:var(--orange); }
.badge-transfer_pending, .badge-blue { background:var(--blue-bg); color:var(--blue); }
.badge-not_for_sale, .badge-archived, .badge-gray { background:var(--border); color:var(--text-muted); }

.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:18px 24px; }
.form-section { grid-column:1/-1; margin-top:12px; padding-top:16px; border-top:1px solid var(--border-light); font-family:Georgia,serif; font-size:.95rem; color:var(--accent); }
.form-group { display:flex; flex-direction:column; gap:5px; }
.form-group.full-width { grid-column:1/-1; }
/* Breathing space between stacked (non-.form-grid) form-groups — e.g. a
   single-column card with several fields in a row. .form-grid already
   spaces its own children via `gap`, so that case is reset back to 0
   here rather than doubling up. */
.form-group + .form-group { margin-top:18px; }
.form-grid .form-group + .form-group { margin-top:0; }
label { font-size:.85rem; font-weight:500; color:var(--text-muted); }
label .required { color:var(--red); margin-left:2px; }
input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="date"],input[type="password"],input[type="url"],select,textarea {
  width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius); font-size:.92rem; font-family:inherit; background:#fff; color:var(--text); transition:border-color .15s,box-shadow .15s; appearance:none; }
input:focus,select:focus,textarea:focus { outline:2px solid var(--accent-line, #d4ad50); outline-offset:-1px; border-color:var(--accent-line, #d4ad50); box-shadow:0 0 0 3px var(--accent-light, rgba(139,105,20,.12)); }
textarea { resize:vertical; min-height:90px; }
select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6a6a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; padding-right:32px; }
.field-hint { font-size:.78rem; color:var(--text-muted); margin-top:2px; }
.field-error { font-size:.78rem; color:var(--red); font-weight:600; margin-top:2px; display:flex; align-items:center; gap:4px; }
.text-muted { color:var(--text-muted); }
.sub-body { font-size:.9rem; color:var(--text); margin-top:4px; margin-bottom:0; }
.sub-hint { font-size:.82rem; color:var(--text-muted); margin-top:4px; margin-bottom:0; }
.form-group.has-error input,.form-group.has-error select,.form-group.has-error textarea { border-color:var(--red); box-shadow:0 0 0 3px rgba(192,57,43,.12); }
.form-actions { display:flex; gap:12px; align-items:center; margin-top:28px; padding-top:20px; border-top:1px solid var(--border-light); flex-wrap:wrap; }

.alert { padding:12px 16px; border-radius:var(--radius); margin-bottom:20px; font-size:.9rem; border-left:4px solid; }
.alert ul { margin:6px 0 0 18px; }
.alert-success { background:var(--green-bg); border-color:var(--green); color:var(--green); }
.alert-error   { background:var(--red-bg);   border-color:var(--red);   color:var(--red); }
.alert-info    { background:var(--blue-bg);  border-color:var(--blue);  color:var(--blue); }
.alert-warning { background:var(--orange-bg);border-color:var(--orange);color:var(--orange); }

.detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:24px; }
.detail-section h3 { font-family:Georgia,serif; font-size:.95rem; font-weight:normal; color:var(--accent); margin-bottom:12px; padding-bottom:6px; border-bottom:1px solid var(--border-light); }
.detail-section +.detail-section { margin-top:16px; padding-top:16px; border-top:1px solid var(--border-light); }
body.style-gold .detail-section + .detail-section { border-top:none; padding-top:0; }
/* Clamp a long text block to N lines (set via data-clamp-lines, JS applies -webkit-line-clamp) with a "Show more"/"Show less" toggle */
.clamp-text[data-clamp-lines] p { display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden; }
.clamp-text.is-expanded p { display:block; -webkit-line-clamp:unset; }
.clamp-text-toggle { background:none; border:none; padding:4px 0 0; margin-top:4px; font-size:.82rem; color:var(--accent); cursor:pointer; text-decoration:underline; }
.card-table-header { padding:20px 24px 12px; display:flex; justify-content:space-between; align-items:center; }
.card-table-header h2 { font-family:Georgia,serif; font-size:1.1rem; font-weight:normal; }
dl { display:grid; grid-template-columns:auto 1fr; gap:6px 16px; align-items:baseline; }
dt { font-size:.85rem; font-weight:500; color:var(--text-muted); white-space:nowrap; }
dd { font-size:.92rem; color:var(--text); }

.artwork-image { width:100%; max-width:400px; border-radius:var(--radius); border:1px solid var(--border); display:block; margin-bottom:16px; }
.image-placeholder { width:100%; max-width:400px; height:200px; background:var(--bg); border:2px dashed var(--border); border-radius:var(--radius); display:flex; align-items:center; justify-content:center; color:var(--text-muted); font-size:.85rem; margin-bottom:16px; }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--nav-bg); padding:24px; }
.login-box { background:var(--surface); border-radius:8px; padding:40px 44px; width:100%; max-width:420px; box-shadow:0 8px 32px rgba(0,0,0,.35); }
.login-logo { font-family:Georgia,serif; font-size:1.5rem; color:var(--accent); text-align:center; margin-bottom:4px; }
.login-subtitle { text-align:center; font-size:.9rem; color:var(--text-muted); margin-bottom:32px; }
.login-box .btn { width:100%; justify-content:center; padding:11px; }

.filter-bar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:20px; }
.filter-bar input,.filter-bar select { width:auto; min-width:140px; height:34px; padding:0 12px; font-size:.87rem; box-sizing:border-box; }
.filter-bar .btn { height:34px; padding:0 14px; font-size:.87rem; box-sizing:border-box; }

.thumb { width:48px; height:48px; object-fit:cover; border-radius:4px; border:1px solid var(--border); }
.thumb-placeholder { width:48px; height:48px; background:var(--bg); border:1px solid var(--border); border-radius:4px; display:flex; align-items:center; justify-content:center; color:var(--text-muted); font-size:.7rem; }

.sale-summary { background:var(--accent-light); border:1px solid var(--accent-line); border-radius:var(--radius); padding:18px 22px; margin-bottom:24px; display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px 24px; }
.sale-summary-item .label { font-size:.85rem; font-weight:500; color:var(--accent-dark); margin-bottom:2px; }
.sale-summary-item .value { font-family:Georgia,serif; font-size:1.2rem; color:var(--accent-dark); }


.dash-layout { display:grid; grid-template-columns:200px 1fr; gap:20px; align-items:stretch; margin-bottom:24px; }
.dash-stats { display:flex; flex-direction:column; gap:8px; }
.stat-card-v { display:flex; flex-direction:column; align-items:flex-start; padding:8px 12px; border-top:none; border-left:3px solid var(--accent); position:relative; }
.stat-card-v .stat-label { font-size:.8rem; line-height:1; }
.stat-card-v .stat-value { font-size:1.15rem; margin-top:3px; }
.stat-card-v .stat-value-sm { font-size:1rem; }
.stat-card-v .drag-grip { position:absolute; top:6px; right:8px; }
.dash-chart-card { padding:20px; display:flex; flex-direction:column; }
.dash-chart-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.dash-range-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.dash-range-form select, .dash-range-form input[type=date] { font-size:.82rem; padding:5px 8px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--text); }
.dash-chart-checks { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:14px; padding-top:14px; border-top:1px solid var(--border-light); }
.dash-check { display:flex; align-items:center; gap:6px; font-size:.82rem; cursor:pointer; user-select:none; color:var(--text-muted); }
.dash-check input { accent-color:var(--accent); cursor:pointer; flex-shrink:0; }
.stat-now { font-size:.72rem; font-weight:500; background:var(--border-light); color:var(--text-muted); border-radius:3px; padding:0 4px; vertical-align:middle; }
.drag-grip { font-size:1rem; color:#8a8a8a; /* >=3:1 on white (was --border, ~1.4:1) */ cursor:grab; padding:0 2px; user-select:none; transition:color .15s; flex-shrink:0; }
.stat-card-v:hover .drag-grip { color:var(--text-muted); }
.drag-grip:active { cursor:grabbing; }


.breadcrumb { font-size:.82rem; color:var(--text-muted); margin-bottom:20px; }
.breadcrumb a { color:var(--text-muted); }
.breadcrumb a:hover { color:var(--accent); }
.breadcrumb .sep { margin:0 6px; }

.empty-state { text-align:center; padding:48px 24px; color:var(--text-muted); }
.empty-state .empty-icon { color:var(--border); line-height:0; margin-bottom:14px; }
.empty-state p { margin-bottom:16px; }

#toast-container { position:fixed; bottom:24px; right:24px; z-index:9999; display:flex; flex-direction:column; gap:10px; pointer-events:none; }
.toast { background:var(--surface); border:1px solid var(--border); border-left:4px solid; border-radius:var(--radius); padding:12px 16px; min-width:260px; max-width:380px; box-shadow:0 4px 20px rgba(0,0,0,.15); font-size:.88rem; pointer-events:all; display:flex; align-items:flex-start; gap:10px; animation:toast-in .25s ease; }
.toast-success { border-left-color:var(--green); color:var(--green); }
.toast-error   { border-left-color:var(--red);   color:var(--red); }
.toast-info    { border-left-color:var(--blue);   color:var(--blue); }
.toast-warning { border-left-color:var(--orange); color:var(--orange); }
.toast-msg { flex:1; color:var(--text); }
.toast-close { cursor:pointer; font-size:.8rem; line-height:1.4; color:var(--text-muted); background:none; border:none; padding:0; flex-shrink:0; }
.toast-close:hover { color:var(--text); }
@keyframes toast-in { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }

/* Small confirm dialog (unsell, reverse sale): the overlay keeps an inline display:none that the page script toggles. */
.confirm-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; align-items:center; justify-content:center; }
.confirm-card { background:var(--surface); border-radius:8px; padding:28px; max-width:460px; width:90%; box-shadow:0 4px 24px rgba(0,0,0,.2); }
.confirm-card h3 { margin:0 0 8px; }
.confirm-card > p { font-size:.9rem; color:var(--text-muted); margin-bottom:16px; }

.picker-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:900; align-items:center; justify-content:center; }
.picker-modal-overlay.open { display:flex; }
.picker-modal { background:#fff; border-radius:8px; width:min(92vw,800px); max-height:82vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,.18); }
.picker-modal-header { padding:14px 20px; border-bottom:1px solid var(--border-light); display:flex; align-items:center; gap:12px; }
.picker-modal-header h3 { flex:1; font-size:1rem; margin:0; }
.picker-body { flex:1; overflow-y:auto; padding:16px 20px; }


.table-tabs { display:flex; gap:4px; padding-left:12px; margin:8px 0 -1px; position:relative; z-index:1; }   /* tabs attached to the top of the table card below */
.table-tabs a { padding:9px 22px; border:1px solid var(--border); border-bottom:0; border-radius:var(--radius) var(--radius) 0 0; background:var(--bg); color:var(--text-muted); font-size:.9rem; text-decoration:none; }
.table-tabs a:hover { color:var(--text); }
.table-tabs a.on { background:var(--th-bg); color:var(--text); font-weight:600; }   /* same tint as the table header it joins */
.table-tabs + div > .card { border-top-left-radius:0; }   /* the card sits inside #sales-panel */
.pagination-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:16px; scroll-margin-top:70px; }
.pagination-label { font-size:.85rem; font-weight:normal; color:var(--text-muted); }   /* the "Paginate at" label: plain weight, not the medium-weight form-label style */
.pagination-info { font-size:.82rem; color:var(--text-muted); flex:1; min-width:160px; }
.pagination-controls { display:flex; gap:4px; flex-wrap:wrap; }
.page-btn { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 8px; border-radius:var(--radius); border:1px solid var(--border); background:#fff; color:var(--text); font-size:.82rem; text-decoration:none; }
.page-btn:hover { border-color:var(--accent); color:var(--accent); text-decoration:none; }
.page-btn.active { background:var(--accent-light, #f5edd8); border-color:var(--accent-line, #d4ad50); color:var(--accent-dark, #6a4f0e); font-weight:600; }   /* selection = muted brand tint + muted outline */
.page-btn.disabled { opacity:.4; pointer-events:none; }

#scroll-top { position:fixed; bottom:80px; right:24px; width:38px; height:38px; border-radius:50%; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow); cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text-muted); opacity:0; visibility:hidden; transition:opacity .2s,visibility .2s,background .15s,color .15s; z-index:500; }
#scroll-top.scroll-top-visible { opacity:1; visibility:visible; }
#scroll-top:hover { background:var(--accent-light); color:var(--accent); border-color:var(--accent); }

/* Image drop zone (artwork_add / artwork_edit) */
.drop-zone { border:2px dashed var(--border); border-radius:8px; padding:28px 20px; text-align:center; cursor:pointer; background:var(--bg); transition:border-color .15s,background .15s; display:flex; flex-direction:column; align-items:center; gap:6px; user-select:none; }
.drop-zone:hover, .drop-zone.drag-over { border-color:var(--accent); background:var(--accent-light); }
.drop-zone.has-file { border-color:var(--accent); border-style:solid; background:var(--accent-light); }
.drop-zone-icon { color:var(--text-muted); line-height:0; }
.drop-zone-text { font-size:.9rem; color:var(--text); }
.drop-zone-hint { font-size:.78rem; color:var(--text-muted); }

/* Profile page: other cards in a grid (left), the tall Notification Preferences card beside them (right) */
.profile-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:24px; align-items:start; }
.profile-layout-single { grid-template-columns:minmax(0,1fr); }
.profile-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:24px; align-items:start; }

/* Notification bell (core/notifications.php, includes/nav.php). One panel shared by a desktop bell (in .nav-right)
   and a mobile bell (beside the hamburger). The panel uses the page's light surface, not the nav colours. */
.nav-bell { position:relative; display:flex; align-items:center; background:none; border:none; cursor:pointer; color:var(--nav-text); padding:7px; border-radius:var(--radius); transition:background .15s,color .15s; }
.nav-bell:hover { background:var(--nav-hover); color:var(--nav-hover-text); }
.nav-bell-mobile { display:none; }
.nav-bell-badge { position:absolute; top:0; right:0; min-width:16px; height:16px; padding:0 4px; border-radius:99px; background:var(--red); color:#fff; font-size:.7rem; font-weight:600; line-height:16px; text-align:center; }
.nav-bell-badge[hidden] { display:none; }
.nav-notif-panel { display:none; position:absolute; top:100%; right:12px; width:380px; max-width:calc(100vw - 24px); background:var(--surface); color:var(--text); border:1px solid var(--border); border-top:none; border-radius:0 0 var(--radius) var(--radius); box-shadow:0 6px 18px rgba(0,0,0,.25); z-index:200; }
.nav-notif-panel.open { display:block; }
.nav-notif-head { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-bottom:1px solid var(--border-light); font-size:.9rem; }
.nav-notif-head-actions { display:flex; align-items:center; gap:10px; }
.nav-notif-compose { display:flex; align-items:center; background:none; border:none; padding:2px; border-radius:var(--radius); color:var(--text-muted); cursor:pointer; }
.nav-notif-compose:hover { color:var(--accent); background:var(--accent-light); }
.nav-notif-msg { white-space:pre-line; color:var(--text); }
.msg-modal { width:min(92vw,460px); }
.msg-modal-meta { display:flex; justify-content:space-between; gap:12px; margin-top:4px; }
.msg-modal-error { margin:8px 0 0; color:var(--red); font-size:.85rem; }
.msg-modal-error[hidden] { display:none; }
.msg-modal-foot { display:flex; justify-content:flex-end; gap:8px; padding:12px 20px; border-top:1px solid var(--border-light); }
.nav-notif-markread { background:none; border:none; color:var(--accent); cursor:pointer; font-size:.8rem; padding:0; }
.nav-notif-markread:hover { color:var(--accent-dark); text-decoration:underline; }
.nav-notif-markread[hidden] { display:none; }
.nav-notif-list { max-height:min(420px, 60vh); overflow-y:auto; }
.nav-notif-item { padding:10px 14px; border-bottom:1px solid var(--border-light); border-left:3px solid transparent; color:var(--text); font-size:.85rem; line-height:1.4; }
.nav-notif-item:hover { background:var(--row-hover); }
.nav-notif-item.is-unread { border-left-color:var(--accent); background:var(--accent-light); }
.nav-notif-item.is-unread .nav-notif-title { font-weight:600; }
.nav-notif-item.is-failed .nav-notif-title { color:var(--red); }
.nav-notif-main { display:block; color:inherit; text-decoration:none; }
.nav-notif-main:hover { color:inherit; text-decoration:none; }
.nav-notif-title, .nav-notif-detail { display:block; overflow-wrap:anywhere; }
.nav-notif-detail { color:var(--text-muted); font-size:.8rem; }
.nav-notif-foot { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-top:2px; }
.nav-notif-time { color:var(--text-muted); font-size:.75rem; }
.nav-notif-actions { color:var(--text-muted); font-size:.72rem; white-space:nowrap; }
.nav-notif-actions button { background:none; border:none; padding:0; font:inherit; color:var(--text-muted); cursor:pointer; text-decoration:underline; }
.nav-notif-actions button:hover { color:var(--accent); }
.nav-notif-empty { padding:18px 14px; color:var(--text-muted); font-size:.85rem; }
.nav-notif-all { display:block; padding:10px 14px; text-align:center; font-size:.85rem; border-top:1px solid var(--border-light); }
.notif-page { padding:0; overflow:hidden; }
.notif-page .nav-notif-item:last-child { border-bottom:none; }
.notif-pager { display:flex; gap:16px; align-items:center; justify-content:center; margin:14px 0; font-size:.88rem; }

@media (max-width:768px) {
  .nav { padding:0 12px; flex-wrap:wrap; }
  .nav-toggle { display:flex; margin-left:0; }
  .nav-bell-mobile { display:flex; margin-left:auto; }
  .nav-bell-desktop { display:none; } /* the mobile bell beside the hamburger replaces it */
  .profile-layout { grid-template-columns:minmax(0,1fr); }
  .nav-notif-panel { left:0; right:0; width:auto; max-width:none; border-left:none; border-right:none; border-radius:0; }
  .nav-links { display:none; flex:none; width:100%; }
  .nav-right { display:none; flex:none; width:100%; margin-left:0; }
  .nav-open .nav-links { display:flex; flex-direction:column; border-top:1px solid var(--nav-m-line); }
  .nav-open .nav-right { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px; border-top:1px solid var(--nav-m-line); }
  .nav-links a { height:auto; padding:13px 16px; border-bottom:1px solid var(--nav-m-line); font-size:.9rem; }
  .nav-dropdown { display:flex; flex-direction:column; align-items:stretch; position:static; }
  .nav-dropdown-toggle { height:auto; padding:13px 16px; border-bottom:1px solid var(--nav-m-line); font-size:.9rem; }
  .nav-dropdown-menu { position:static; border:none; box-shadow:none; min-width:auto; background:var(--nav-m-menu-bg); }
  .nav-dropdown-menu a { padding:11px 28px; border-bottom:1px solid var(--nav-m-menu-divider); font-size:.9rem; }
  .nav-right .nav-dropdown { width:100%; }
  .nav-right .nav-dropdown-toggle { padding:13px 16px; font-size:.9rem; border-radius:0; }
  .nav-right .nav-dropdown-menu { position:static; }
  .nav-right .nav-dropdown-menu a { padding:11px 28px; font-size:.9rem; }
  .page-wrapper { padding:20px 14px 40px; }
  .form-grid { grid-template-columns:1fr; }
  .card-grid-2-1 { grid-template-columns:1fr; }
  .dash-layout { grid-template-columns:1fr; }
  .dash-stats { display:grid; grid-template-columns:repeat(2,1fr); }
  .stat-card-v { border-left:none; border-top:3px solid var(--accent); }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .login-box { padding:28px 22px; }
  .page-header { flex-direction:column; align-items:flex-start; }
}

/* Respect the OS "reduce motion" setting: no smooth scroll or slide effects. */
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
.avatar-circle { width:64px; height:64px; border-radius:50%; object-fit:cover; border:1px solid var(--border-light); flex-shrink:0; }
.avatar-circle.avatar-sm { width:36px; height:36px; }
img.avatar-circle { display:block; }
.avatar-circle.avatar-initials { display:flex; box-sizing:border-box; line-height:1; align-items:center; justify-content:center; background:var(--accent-light); color:var(--accent-dark); font-size:1.3rem; }
.avatar-circle.avatar-sm.avatar-initials { font-size:.8rem; }
dd.dd-trunc { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
