/*
 * DADS tokens copied from @digital-go-jp/design-tokens 2.1.0, dist/tokens.css.
 * https://github.com/digital-go-jp/design-tokens
 * MIT License
 * 
 * Copyright (c) 2023 デジタル庁
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * 
 */
:root {
  --color-primitive-blue-50: #e8f1fe;
  --color-primitive-blue-900: #0017c1;
  --color-primitive-blue-1000: #00118f;
  --color-primitive-yellow-100: #fff0b3;
  --color-primitive-red-50: #fdeeee;
  --color-primitive-red-900: #ce0000;
  --color-neutral-white: #ffffff;
  --color-neutral-black: #000000;
  --color-neutral-solid-gray-50: #f2f2f2;
  --color-neutral-solid-gray-200: #cccccc;
  --color-neutral-solid-gray-600: #666666;
  --color-neutral-solid-gray-900: #1a1a1a;
  --font-weight-400: 400;
  --font-weight-700: 700;
  --font-family-sans: 'Noto Sans JP', sans-serif;
  --font-size-14: 0.875rem;
  --font-size-16: 1rem;
  --font-size-20: 1.25rem;
  --font-size-24: 1.5rem;
  --font-size-32: 2rem;
  --line-height-150: 1.5;
  --line-height-170: 1.7;
  --border-radius-4: 0.25rem;
  --border-radius-8: 0.5rem;
  --color-semantic-error-2: var(--color-primitive-red-900);
}
/* Application aliases and locally defined spacing (4px increments). */
:root {
  --ground: var(--color-neutral-solid-gray-50);
  --surface: var(--color-neutral-white);
  --text: var(--color-neutral-solid-gray-900);
  --muted: var(--color-neutral-solid-gray-600);
  --border: var(--color-neutral-solid-gray-200);
  --accent: var(--color-primitive-blue-900);
  --accent-hover: var(--color-primitive-blue-1000);
  --selected: var(--color-primitive-blue-50);
  --error: var(--color-semantic-error-2);
  --error-ground: var(--color-primitive-red-50);
  --focus: var(--color-primitive-yellow-100);
  --focus-ink: var(--color-neutral-black);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--ground); font-family: var(--font-family-sans); font-size: var(--font-size-16); font-weight: var(--font-weight-400); line-height: var(--line-height-170); overflow-wrap: anywhere; }
.wrap { width: 100%; max-width: 1440px; min-width: 0; margin: 0 auto; padding-inline: var(--space-8); }
.admin-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding-block: var(--space-6); }
.admin-brand { font-size: var(--font-size-24); text-decoration: none; color: var(--text); }
.admin-email { min-width: 0; margin-left: auto; color: var(--muted); }
.admin-nav { display: flex; flex-wrap: wrap; width: 100%; gap: var(--space-2); }
.admin-nav a, .filters a { padding: var(--space-2) var(--space-4); border-radius: var(--border-radius-4); }
.admin-nav a { color: var(--text); text-decoration: none; }
.admin-nav a[aria-current="page"], .filters a[aria-current="page"] { color: var(--accent); background: var(--selected); text-decoration: underline; text-decoration-thickness: 2px; }
.admin-main { padding-block: var(--space-8) var(--space-12); }
h1, h2, h3 { font-weight: var(--font-weight-700); line-height: var(--line-height-150); }
h1 { font-size: var(--font-size-32); margin: 0 0 var(--space-8); }
h2 { font-size: var(--font-size-24); margin: 0 0 var(--space-6); }
h3 { font-size: var(--font-size-20); margin: var(--space-6) 0 var(--space-4); }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }
a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; max-width: 100%; color: var(--accent); font-weight: var(--font-weight-700); text-decoration: underline; text-underline-offset: 4px; touch-action: manipulation; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.admin-main > section, .panel, .admin-main > form:not(.inline), .empty { min-width: 0; padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--border-radius-8); background: var(--surface); }
.admin-main > section + section, section + .panel, section + form, form + form, .panel + form, .table-wrap + form { margin-top: var(--space-6); }
.admin-main > .actions { margin-bottom: var(--space-6); }
form { min-width: 0; max-width: 800px; width: 100%; }
form > section + section { margin-top: var(--space-8); }
form > section { margin-bottom: var(--space-6); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-6); }
.inline { display: inline; width: auto; margin: 0; }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 48px; max-width: 100%; padding: var(--space-3) var(--space-6); border: 1px solid var(--accent); border-radius: var(--border-radius-4); background: var(--accent); color: var(--surface); font: inherit; font-weight: var(--font-weight-700); line-height: var(--line-height-150); white-space: normal; overflow-wrap: anywhere; text-align: center; cursor: pointer; touch-action: manipulation; text-decoration: none; }
button:hover, .button-link:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--surface); }
.button-secondary { background: var(--surface); color: var(--accent); }
.button-secondary:hover { background: var(--selected); color: var(--accent-hover); }
.button-danger { background: var(--surface); color: var(--error); border-color: var(--error); }
.button-danger:hover { background: var(--error-ground); color: var(--error); border-color: var(--error); }
button:disabled { cursor: not-allowed; color: var(--muted); background: var(--ground); border-color: var(--muted); }
.field { min-width: 0; margin-bottom: var(--space-6); }
label { display: block; margin-bottom: var(--space-2); font-weight: var(--font-weight-700); }
input, textarea, select { width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: var(--space-2) var(--space-4); border: 1px solid var(--muted); border-radius: var(--border-radius-4); background: var(--surface); color: var(--text); font: inherit; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
[aria-invalid="true"] { border: 2px solid var(--error); }
.required { display: inline-block; margin-left: var(--space-2); color: var(--error); font-size: var(--font-size-14); font-weight: var(--font-weight-700); white-space: nowrap; }
fieldset { min-width: 0; margin: 0 0 var(--space-6); padding: 0; border: 0; }
legend { padding: 0; margin-bottom: var(--space-4); font-weight: var(--font-weight-700); }
.checks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
label.check, label.agree { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; min-width: 44px; margin: 0; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-height: 24px; flex: 0 0 24px; padding: 0; margin: 0; accent-color: var(--accent); }
.check-text { min-width: 0; }
fieldset:has(> .error) .checks, label:has(input[aria-invalid="true"]) { border: 2px solid var(--error); border-radius: var(--border-radius-4); padding: var(--space-2); }
.error { color: var(--error); margin-top: var(--space-2); }
p.error[role="alert"]:not(.field > .error) { padding: var(--space-4); border: 1px solid var(--error); border-radius: var(--border-radius-4); background: var(--error-ground); }
.notice { padding: var(--space-4); border: 1px solid var(--accent); border-radius: var(--border-radius-4); color: var(--accent); background: var(--selected); }
.empty { color: var(--muted); }
.status { display: inline-block; max-width: 100%; padding: var(--space-1) var(--space-2); border: 1px solid var(--muted); border-radius: var(--border-radius-4); background: var(--ground); color: var(--text); font-size: var(--font-size-14); font-weight: var(--font-weight-700); line-height: var(--line-height-150); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: var(--space-4); align-items: end; }
.cancel-mode + .cancel-mode, .cancel-mode + .field, .split-prices { margin-block: var(--space-6); }
dl.detail, dl.booking-detail { margin: 0; }
dl.detail dt, dl.booking-detail dt { font-weight: var(--font-weight-700); }
dl.detail dd, dl.booking-detail dd { margin: var(--space-1) 0 0; min-width: 0; }
dl.detail dd + dt, dl.booking-detail dd + dt { margin-top: var(--space-6); }
.pre-line { white-space: pre-line; }
.pre-wrap, .mail-body { white-space: pre-wrap; }
.mail-body { font: inherit; }
.break { overflow-wrap: anywhere; }
.order-input { max-width: 96px; }
.money { display: inline-block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--border-radius-4); background: var(--surface); margin-bottom: var(--space-4); }
/* A persistent, high-contrast track makes horizontal scrolling discoverable. */
.table-wrap::-webkit-scrollbar { height: 16px; }
.table-wrap::-webkit-scrollbar-track { background: var(--border); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--muted); border: 3px solid var(--border); border-radius: var(--border-radius-4); }
@supports not selector(::-webkit-scrollbar) {
  .table-wrap { scrollbar-width: auto; scrollbar-color: var(--muted) var(--border); }
}
table { width: 100%; min-width: 640px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: var(--space-4); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--ground); font-weight: var(--font-weight-700); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
/* Automatic layout lets large amounts grow inside the scroll region. */
.readable-table { table-layout: auto; }
.bookings-table :is(th, td):nth-child(4),
.payments-table :is(th, td):nth-child(2), .payments-table :is(th, td):nth-child(5),
.works-table :is(th, td):nth-child(2), .works-table :is(th, td):nth-child(3), .works-table :is(th, td):nth-child(4), .works-table :is(th, td):nth-child(5),
.recruits-table :is(th, td):nth-child(4), .refunds-table :is(th, td):nth-child(3),
.tasks-table :is(th, td):nth-child(2), .survey-table :is(th, td):nth-child(1),
.entries-table :is(th, td):nth-child(8), .split-table :is(th, td):nth-child(n+2) { text-align: right; white-space: nowrap; }
.touch-link { padding-block: var(--space-2); }
/* The yellow surface and black outline remain distinct without shadows. */
body.admin :focus-visible { outline: 3px solid var(--focus-ink); outline-offset: 2px; background-color: var(--focus); color: var(--focus-ink); }
.check:has(input:focus-visible), .agree:has(input:focus-visible) { outline: 3px solid var(--focus-ink); outline-offset: 2px; background: var(--focus); color: var(--focus-ink); }
.table-wrap:focus-visible { border-color: var(--focus-ink); background: var(--focus); padding: var(--space-1); }
.table-wrap :focus-visible { outline-offset: -3px; }
@media (max-width: 767px) {
  .wrap { padding-inline: var(--space-4); }
  .admin-header-inner { align-items: flex-start; gap: var(--space-2); padding-block: var(--space-4); }
  .admin-brand, .admin-email { width: 100%; margin-left: 0; }
  .admin-brand { font-size: var(--font-size-20); }
  .admin-nav { margin-top: var(--space-2); }
  .admin-nav a { padding-inline: var(--space-3); }
  h1 { font-size: var(--font-size-24); }
  h2 { font-size: var(--font-size-20); }
  .admin-main > section, .panel, .admin-main > form:not(.inline), .empty { padding: var(--space-4); }
}
@media (forced-colors: active) {
  body.admin :focus-visible { outline-color: Highlight; }
  .admin-nav a[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
