/* Organiser pages of AUTH (online registration, check-in, judges, food & shop, volunteers) — one
   look for all, scoped by #shpadm (adm-lib.php: aut_adm_open). The accounts of the server keep
   the core's look (#autadm, at the end).
   For a computer, compact (user's choice: a phone is the exception here — the volunteers' pages
   have their own stylesheets), using the whole width of the window. Charter colours (CHARTE_GRAPHIQUE.md): blue carries
   the structure, coral and green are signals. One primary button per block; the page's save
   button is fixed at the bottom right (.sa-save, assets/admin.js).

   Levels: h1 the page (18 px), h2 a block (14 px), h3 a part of a block (13 px); text 13 px,
   hints 12 px. */

#shpadm { color: #20263d; font-size: 13px; line-height: 1.4; }
#shpadm h3 { font-size: 13px; color: #01367c; margin: 10px 0 4px; }
#shpadm h1 { font-size: 18px; color: #01367c; margin: 0 0 6px; }
#shpadm h2 { font-size: 14px; color: #0254a8; margin: 12px 0 6px; }
#shpadm h2:first-child { margin-top: 0; }
#shpadm .sa-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
#shpadm .sa-lead { color: #4c4e50; margin: 4px 0 10px; }
#shpadm .sa-hint { color: #7d8183; font-size: 12px; margin: 3px 0 6px; }
#shpadm .sa-muted { color: #7d8183; }
#shpadm small { display: block; color: #7d8183; font-size: 12px; font-weight: normal; }

#shpadm .sa-nav, #shpadm .sa-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
#shpadm .sa-nav a, #shpadm .sa-tabs a { padding: 4px 10px; border: 1px solid #d2d4d6; border-radius: 5px;
    background: #f7f7f7; color: #20263d; text-decoration: none; }
#shpadm .sa-nav a:hover, #shpadm .sa-tabs a:hover { background: #f0f4ff; border-color: #a7d6ff; }
#shpadm .sa-nav a.on, #shpadm .sa-tabs a.on { background: #0254a8; border-color: #0254a8; color: #fff; }

#shpadm .sa-card { background: #fff; border: 1px solid #d2d4d6; border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 10px 12px; margin: 0 0 10px; }

#shpadm .sa-msg { padding: 6px 10px; border-radius: 6px; margin: 0 0 10px; border: 1px solid; }
#shpadm .sa-msg ul { margin: 4px 0 0 18px; padding: 0; }
#shpadm .sa-ok { background: #d2f4cd; border-color: #75ae77; color: #04ac0b; }
#shpadm .sa-err { background: #ffd6db; border-color: #bb7575; color: #a80000; }
#shpadm .sa-warn { background: #fdebd6; border-color: #cb8137; color: #7a4a10; }
#shpadm .sa-info { background: #f0f4ff; border-color: #a7d6ff; color: #01367c; }

#shpadm input[type=text], #shpadm input[type=number], #shpadm input[type=datetime-local], #shpadm input[type=date],
#shpadm input[type=email], #shpadm input[type=password], #shpadm input[type=search], #shpadm select, #shpadm textarea {
    padding: 4px 6px; border: 1px solid #d2d4d6; border-radius: 5px; font-size: 13px; max-width: 100%; box-sizing: border-box; }
#shpadm input:focus, #shpadm select:focus, #shpadm textarea:focus { outline: 2px solid #a7d6ff; border-color: #0254a8; }
#shpadm textarea { font-family: inherit; width: 100%; }
#shpadm .sa-num { width: 90px; }
#shpadm .sa-letter { width: 44px; text-align: center; text-transform: uppercase; font-weight: bold; }

#shpadm .sa-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 6px 0 0; }
#shpadm .sa-f { display: flex; flex-direction: column; gap: 3px; }
#shpadm .sa-f > span { font-size: 12px; color: #4c4e50; }
#shpadm .sa-f.sa-grow, #shpadm .sa-f.sa-wide { flex: 1 1 260px; }
#shpadm .sa-f.sa-wide { margin-top: 6px; }
#shpadm .sa-f.sa-grow input, #shpadm .sa-f.sa-wide input { width: 100%; }
#shpadm .sa-checks { display: flex; flex-direction: column; gap: 5px; margin: 4px 0 6px; }
#shpadm .sa-row .sa-checks { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
#shpadm .sa-chk { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; }
#shpadm .sa-chk input { margin-top: 2px; }

#shpadm .sa-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 6px 10px; border-radius: 6px; border: 1px solid #d2d4d6; background: #f7f7f7; }
#shpadm .sa-switch.sa-on { background: #d2f4cd; border-color: #75ae77; }
/* Openings one under the other (food & shop, check-in): each switch with its buttons. */
#shpadm .sa-bar + .sa-switch, #shpadm .sa-under + .sa-switch, #shpadm .sa-hint + .sa-switch { margin-top: 12px; }
#shpadm .sa-under { margin: 6px 0 0 12px; }
/* Two openings side by side (food & shop: pre-orders | phone orders): the switches on one line,
   their buttons on the next, what belongs to the left one below it; one under the other on a
   narrow screen. */
#shpadm .sa-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px;
    grid-template-areas: "ls rs" "lb rb" "lx ."; }
#shpadm .sa-pair + .sa-switch { margin-top: 12px; }
/* The bars of a pair start at the top: their buttons stay on one level, whatever unfolds under one
   of them. A field beside a button (pre-orders deadline): label and input on the line; its
   explanation takes the whole width of the bar, under them. */
#shpadm .sa-pair > .sa-bar { align-items: flex-start; }
#shpadm .sa-inline-f { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: #4c4e50; }
#shpadm .sa-bar > .sa-help { flex: 0 0 100%; margin: 0; }
@media (max-width: 900px) {
    #shpadm .sa-pair { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ls" "lb" "lx" "rs" "rb"; }
    #shpadm .sa-pair > .sa-switch[style*="rs"] { margin-top: 12px; }
}
/* "Volunteers' access" / "Customers' access": address and QR code folded away. */
#shpadm .sa-access { margin-top: 10px; }
#shpadm .sa-access > summary { cursor: pointer; font-weight: 600; color: #0254a8; margin-bottom: 8px; }
#shpadm .sa-access .sa-address-text .sa-bar { margin-top: 6px; }
#shpadm .sa-tag { padding: 2px 10px; border-radius: 5px; font-size: 12px; background: #ddd; border: 1px solid #aaa; color: #333; white-space: nowrap; }
#shpadm .sa-on .sa-tag { background: #fff; border-color: #75ae77; color: #04ac0b; }

#shpadm .sa-btn { padding: 4px 10px; border: 1px solid #d2d4d6; border-radius: 5px; background: #f7f7f7;
    color: #20263d; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
#shpadm .sa-btn:hover { background: #f0f4ff; border-color: #a7d6ff; }
#shpadm .sa-primary { background: #0254a8; border-color: #0254a8; color: #fff; font-weight: 600; }
#shpadm .sa-primary:hover { background: #01367c; border-color: #01367c; }
#shpadm .sa-danger { color: #a80000; border-color: #e8b4ae; background: #fff; }
#shpadm .sa-danger:hover { background: #ffd6db; }
#shpadm .sa-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#shpadm .sa-sticky { position: sticky; bottom: 0; z-index: 5; padding: 10px 0; background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0)); }

#shpadm .sa-scroll { overflow-x: auto; }
#shpadm .sa-table { border-collapse: collapse; width: 100%; }
#shpadm .sa-table th { text-align: left; font-size: 12px; color: #4c4e50; font-weight: 600; padding: 4px 6px; border-bottom: 2px solid #d2d4d6; white-space: nowrap; }
#shpadm .sa-table td { padding: 4px 6px; border-bottom: 1px solid #eef1f7; vertical-align: middle; }
#shpadm .sa-table td.sa-c { text-align: center; }
#shpadm .sa-table td.sa-acts { white-space: nowrap; }
#shpadm .sa-stands .sa-name { min-width: 180px; }

#shpadm .sa-prod { border: 1px solid #d2d4d6; border-left: 4px solid #0254a8; border-radius: 8px; padding: 8px 10px;
    margin: 0 0 8px; background: #fbfcfe; }
#shpadm [hidden] { display: none !important; }
#shpadm .sa-vars { margin: 8px 0 0; padding: 6px 8px; background: #f0f4ff; border-radius: 6px; }
#shpadm .sa-vhead { font-size: 12px; font-weight: 600; color: #01367c; margin-bottom: 6px; }
#shpadm .sa-var { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; margin: 0 0 6px; }
#shpadm .sa-var label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #4c4e50; }
#shpadm .sa-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 8px; padding-top: 6px; border-top: 1px solid #e3e8f4; }
#shpadm .sa-stats { color: #01367c; }
/* A field and what goes with it on its right (catalogue: stock, then what was received, sold, lost). */
#shpadm .sa-inl { display: flex; align-items: center; gap: 8px; }
#shpadm .sa-inl small { display: inline; margin: 0; white-space: nowrap; }

#shpadm .sa-address { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
#shpadm .sa-qr svg { display: block; border: 1px solid #d2d4d6; border-radius: 6px; }
#shpadm .sa-address-text { flex: 1 1 320px; }
#shpadm .sa-url { width: 100%; font-family: Consolas, monospace; }

#shpadm .sa-copy > summary { cursor: pointer; list-style: none; padding: 4px 10px; border: 1px solid #a7d6ff; border-radius: 5px;
    background: #f0f4ff; color: #0254a8; font-weight: 600; }
#shpadm .sa-copy > summary::-webkit-details-marker { display: none; }
#shpadm .sa-copy[open] > summary { background: #0254a8; color: #fff; border-color: #0254a8; }
#shpadm .sa-copy-body { margin-top: 6px; padding: 8px 10px; border: 1px solid #d2d4d6; border-radius: 8px; background: #fff; max-width: 460px; }
#shpadm .sa-copy-body select, #shpadm .sa-copy-body input[type=text] { width: 100%; }
#shpadm .sa-copy-body .sa-btn { margin-top: 8px; }

#shpadm .sa-pdf { display: inline-flex; gap: 6px; align-items: center; color: #0254a8; }

/* Narrow screens (tablet held upright, phone): the points of sale table becomes cards. */
@media (max-width: 760px) {
    #shpadm .sa-stands thead { display: none; }
    #shpadm .sa-stands, #shpadm .sa-stands tbody, #shpadm .sa-stands tr, #shpadm .sa-stands td { display: block; width: 100%; }
    #shpadm .sa-stands tr { border: 1px solid #d2d4d6; border-radius: 8px; padding: 8px; margin: 0 0 10px; }
    #shpadm .sa-stands td { border: 0; padding: 4px 0; text-align: left !important; }
    #shpadm .sa-stands td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: #4c4e50; }
}

/* ---- Shared frame (adm-lib.php) ---------------------------------------------------------- */
#shpadm .sa-title { margin: 2px 0 6px; align-items: center; }
#shpadm .sa-title h1 { margin: 0; }
#shpadm .sa-title-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#shpadm .sa-card > h2:first-child, #shpadm .sa-card > .sa-head:first-child { margin-top: 0; }
#shpadm .sa-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
#shpadm .sa-head h2 { margin: 0; }
#shpadm p { margin: 4px 0; }
#shpadm a { color: #0254a8; }
#shpadm .sa-btn:disabled { opacity: .5; cursor: not-allowed; }
#shpadm .sa-btn-small { padding: 2px 8px; font-size: 12px; }
#shpadm .sa-table tr:hover td { background: #fbfcfe; }
#shpadm .sa-table td.sa-r, #shpadm .sa-table th.sa-r { text-align: right; }
#shpadm .sa-table td.sa-nowrap { white-space: nowrap; }

/* Key figures in a row */
#shpadm .sa-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0 0 10px; }
#shpadm .sa-kpi { background: #fff; border: 1px solid #d2d4d6; border-top: 3px solid #0254a8; border-radius: 8px; padding: 6px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08); }
#shpadm .sa-kpi > span { display: block; font-size: 12px; color: #4c4e50; }
#shpadm .sa-kpi b { display: block; font-size: 17px; color: #01367c; margin-top: 1px; }
#shpadm .sa-kpi small { margin-top: 2px; }

/* State badges */
#shpadm .sa-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
    white-space: nowrap; background: #f7f7f7; border: 1px solid #d2d4d6; color: #4c4e50; }
#shpadm .sa-badge.sa-b-ok { background: #d2f4cd; border-color: #75ae77; color: #035c07; }
#shpadm .sa-badge.sa-b-ko { background: #ffd6db; border-color: #bb7575; color: #a80000; }
#shpadm .sa-badge.sa-b-warn { background: #fdebd6; border-color: #cb8137; color: #7a4a10; }
#shpadm .sa-badge.sa-b-info { background: #f0f4ff; border-color: #a7d6ff; color: #01367c; }

/* Save button of the page: alone, fixed at the bottom right of the screen; the page keeps room
   under its last block. admin.js moves it to the left of the GUIDE module's panel when there. */
#shpadm .sa-save { position: fixed; right: 20px; bottom: 20px; z-index: 900; padding: 8px 20px; font-size: 14px;
    border-radius: 8px; box-shadow: 0 4px 16px rgba(2, 84, 168, .35); }
#shpadm.sa-has-save { padding-bottom: 60px; }

/* A change not saved (.sa-dirty, admin.js), both frames: an orange ring runs round the button.
   Drawn by ::before, outside the button: its size, text and hover stay as they are. When the
   visitor's system asks for less motion, the ring stays, still. */
@property --sa-spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#shpadm .sa-save.sa-dirty::before, #autadm .sa-save.sa-dirty::before {
    --sa-spin: 0deg;
    content: ''; position: absolute; inset: -4px; padding: 3px; border-radius: 11px; pointer-events: none;
    background: conic-gradient(from var(--sa-spin), #ff2b10, #e57b10 25%, #ffb347 50%, #e57b10 75%, #ff2b10);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: sa-spin 2.4s linear infinite; }
@keyframes sa-spin { to { --sa-spin: 360deg; } }
@media (prefers-reduced-motion: reduce) {
    #shpadm .sa-save.sa-dirty::before, #autadm .sa-save.sa-dirty::before { animation: none; }
}

/* Message floating at the top right: the page does not move under the reader's eyes */
#shpadm .sa-toast { position: fixed; top: 16px; right: 20px; z-index: 950; max-width: 420px; margin: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.15); }
#shpadm .sa-default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Explanations on demand (aut_adm_help): a "?" next to a title, a field or an option; its text
   unfolds under it. */
#shpadm .sa-q { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin: 0 0 0 6px;
    padding: 0; border: 1px solid #a7d6ff; border-radius: 50%; background: #f0f4ff; color: #0254a8;
    font: 700 11px/1 Verdana, Arial, sans-serif; cursor: pointer; vertical-align: 1px; }
#shpadm .sa-q:hover, #shpadm .sa-q[aria-expanded=true] { background: #0254a8; border-color: #0254a8; color: #fff; }
#shpadm .sa-help { display: block; margin: 3px 0 6px; padding: 5px 8px; background: #f0f4ff; border-left: 3px solid #a7d6ff;
    border-radius: 0 5px 5px 0; font-size: 12px; font-weight: normal; color: #4c4e50; line-height: 1.4; text-align: left; }
#shpadm .sa-opt { margin: 0; }
#shpadm .sa-opt > .sa-help { margin-left: 22px; }

/* Tabs of a page (aut_adm_tabs): display only. */
#shpadm .sa-tabbar { display: flex; flex-wrap: wrap; gap: 2px; margin: 10px 0 8px; border-bottom: 2px solid #0254a8; }
#shpadm .sa-tab { padding: 5px 12px; border: 1px solid #d2d4d6; border-bottom: 0; border-radius: 6px 6px 0 0; background: #f7f7f7;
    color: #20263d; font: inherit; font-size: 13px; cursor: pointer; }
#shpadm .sa-tab:hover { background: #f0f4ff; }
#shpadm .sa-tab.on { background: #0254a8; border-color: #0254a8; color: #fff; font-weight: 600; }
#shpadm .sa-tab-n { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 700;
    background: #e57b10; color: #fff; }

/* Buttons left without a class of the module look like its own. */
#shpadm button:not([class]), #shpadm input[type=submit]:not([class]), #shpadm input[type=button]:not([class]) {
    padding: 6px 12px; border: 1px solid #d2d4d6; border-radius: 6px; background: #f7f7f7; color: #20263d;
    font: inherit; font-size: 13px; cursor: pointer; }
#shpadm button:not([class]):hover, #shpadm input[type=submit]:not([class]):hover { background: #f0f4ff; border-color: #a7d6ff; }

/* ---- Accounts of the server (aut_adm_open_plain, #autadm) -----------------------------------
   These pages keep the core's look (user's choice: compact, part of ianseo). The frame adds only
   the navigation, as tabs over the core's tables, in the font of the ianseo menus and with the
   core's colour variables (themes follow), on one line: admin.js makes the font smaller as long
   as it does not fit, and lets it wrap only below 9 px. And the fixed save button. */
#autadm .sa-nav { display: flex; flex-wrap: nowrap; gap: 2px; margin: 4px 0 6px; overflow: hidden;
    border-bottom: 2px solid var(--header-dark, #004488); }
#autadm .sa-nav.sa-wrap { flex-wrap: wrap; }
#autadm .sa-nav a { padding: .3em .7em; border-radius: 3px 3px 0 0; white-space: nowrap; text-decoration: none;
    background: var(--table-background, #E1F0FF); color: var(--header-dark, #004488); }
#autadm .sa-nav a:hover { background: var(--bg-cell-header, #BFDDFF); }
#autadm .sa-nav a.on { background: var(--header-dark, #004488); color: var(--row-main-text, #F2F9ff); font-weight: bold; }
#autadm .sa-save { position: fixed; right: 20px; bottom: 20px; z-index: 900; padding: 8px 20px; font-size: 14px; font-weight: 600;
    border: 1px solid #0254a8; border-radius: 8px; background: #0254a8; color: #fff; cursor: pointer;
    box-shadow: 0 4px 16px rgba(2, 84, 168, .35); }
#autadm .sa-save:hover { background: #01367c; border-color: #01367c; }
#autadm.sa-has-save { padding-bottom: 60px; }
#autadm .sa-default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
