/* ==========================================================================
   Custom Stylesheet — Global Arena 指導者バンク
   ==========================================================================
   Author: Rikard Stein
   Description: Shared design tokens and component utilities used alongside
                Tailwind. Provides a single source of truth for colors,
                spacing, radii, typography, form inputs, buttons, modals,
                tables, pagination, and other patterns reused across pages.
                Tuned for parity between desktop, tablet, and smartphone.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
    --app-radius-sm: 0.75rem;
    --app-radius-md: 1rem;
    --app-radius-lg: 1.5rem;
    --app-radius-xl: 2rem;

    --app-tap-min: 44px;

    --app-font-display: 'Plus Jakarta Sans', 'Noto Sans JP', system-ui, sans-serif;
    --app-font-body: 'Noto Sans JP', system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;

    --app-bg: #f1f5f9;
    --app-surface: rgba(255, 255, 255, 0.86);
    --app-surface-soft: rgba(248, 250, 252, 0.82);
    --app-border: rgba(148, 163, 184, 0.22);
    --app-border-strong: rgba(148, 163, 184, 0.4);
    --app-text: #0f172a;
    --app-text-muted: #475569;
    --app-text-faint: #64748b;
    --app-accent: #2563eb;
    --app-accent-strong: #1d4ed8;
    --app-accent-soft: #0284c7;
    --app-danger: #dc2626;
}

.dark {
    --app-bg: #020617;
    --app-surface: rgba(15, 23, 42, 0.82);
    --app-surface-soft: rgba(15, 23, 42, 0.55);
    --app-border: rgba(71, 85, 105, 0.4);
    --app-border-strong: rgba(100, 116, 139, 0.6);
    --app-text: #f8fafc;
    --app-text-muted: #cbd5e1;
    --app-text-faint: #94a3b8;
    --app-accent: #60a5fa;
    --app-accent-strong: #2563eb;
    --app-accent-soft: #38bdf8;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--app-font-body);
    font-feature-settings: "palt";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Latin display text (eyebrows / hero headings) gets a more distinctive face */
.app-eyebrow,
.app-display {
    font-family: var(--app-font-display);
}

/* --------------------------------------------------------------------------
   2. Shell, panels, gradient hero
   -------------------------------------------------------------------------- */

.app-shell {
    background-color: var(--app-bg);
    background-image:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef4ff 42%, #f1f5f9 100%);
    background-attachment: fixed;
}

.dark .app-shell {
    background-image:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(2, 6, 23, 0.98) 100%);
}

.app-panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(20px);
}

.dark .app-panel {
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.42);
}

.app-panel-soft {
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}

.app-gradient-card {
    background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 52%, #22d3ee 100%);
    box-shadow: 0 20px 48px rgba(14, 116, 144, 0.28);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. Typography helpers
   -------------------------------------------------------------------------- */

.app-eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.app-page-title {
    font-family: var(--app-font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   4. Navigation strip & links (header)
   -------------------------------------------------------------------------- */

.app-nav-strip {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--app-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(18px);
}

.dark .app-nav-strip {
    background: rgba(15, 23, 42, 0.72);
    box-shadow: inset 0 1px 0 rgba(51, 65, 85, 0.35);
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.8rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    transition: all 0.2s ease;
    min-height: var(--app-tap-min);
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.72);
    color: #0f172a;
}

.dark .app-nav-link {
    color: #cbd5e1;
}

.dark .app-nav-link:hover {
    background: rgba(30, 41, 59, 0.75);
    color: #f8fafc;
}

.app-nav-link-active,
.app-nav-link-active:hover {
    background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow:
        0 4px 8px -4px rgba(37, 99, 235, 0.55),
        0 2px 4px -2px rgba(15, 23, 42, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   5. Status chips, tags, pills
   -------------------------------------------------------------------------- */

.app-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 9999px;
    padding: 0.38rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 800;
}

/* Generic tag (used for category labels). Pair with text-{color} bg-{color}-100 utilities */
.app-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.3;
    border: 1px solid transparent;
    white-space: nowrap;
}

.app-pill-pinned {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.65rem;
    font-weight: 800;
    background: rgba(254, 226, 226, 0.85);
    color: #b91c1c;
    border: 1px solid rgba(252, 165, 165, 0.6);
}

.dark .app-pill-pinned {
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    border-color: rgba(127, 29, 29, 0.6);
}

.app-pill-unread {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.65rem;
    font-weight: 900;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.app-button-primary,
.app-button-secondary,
.app-button-dark,
.app-button-success,
.app-button-warning,
.app-button-danger,
.app-button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.75rem 1.2rem;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
    min-height: var(--app-tap-min);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.app-button-primary:hover,
.app-button-secondary:hover,
.app-button-dark:hover,
.app-button-success:hover,
.app-button-warning:hover,
.app-button-danger:hover,
.app-button-ghost:hover {
    transform: translateY(-1px);
}

.app-button-primary:disabled,
.app-button-secondary:disabled,
.app-button-dark:disabled,
.app-button-success:disabled,
.app-button-warning:disabled,
.app-button-danger:disabled,
.app-button-ghost:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.app-button-primary {
    background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.app-button-secondary {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--app-border);
    color: #0f172a;
}

.dark .app-button-secondary {
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
}

.app-button-dark {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.dark .app-button-dark {
    background: #2563eb;
}

.app-button-success {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(16, 185, 129, 0.22);
}

.app-button-warning {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.22);
}

.app-button-danger {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(220, 38, 38, 0.18);
}

.app-button-ghost {
    border: 1px solid var(--app-border);
    color: #475569;
    background: rgba(255, 255, 255, 0.45);
}

.dark .app-button-ghost {
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.45);
}

/* Compact button modifier for table rows / chips */
.app-button-compact {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    min-height: 36px;
    border-radius: 0.85rem;
}

/* --------------------------------------------------------------------------
   7. Form inputs (text, email, select, textarea, file)
   -------------------------------------------------------------------------- */

.app-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.4rem;
}

.dark .app-label {
    color: #cbd5e1;
}

.app-label-eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.dark .app-label-eyebrow {
    color: #64748b;
}

.app-input,
.app-select,
.app-textarea {
    width: 100%;
    border-radius: var(--app-radius-sm);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    color: #0f172a;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    min-height: var(--app-tap-min);
}

.app-textarea {
    min-height: calc(var(--app-tap-min) * 1.7);
    line-height: 1.6;
}

.app-input::placeholder,
.app-textarea::placeholder {
    color: #94a3b8;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
    border-color: #2563eb;
    background: #f8fafc;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dark .app-input,
.dark .app-select,
.dark .app-textarea {
    border-color: rgba(71, 85, 105, 0.6);
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
}

.dark .app-input::placeholder,
.dark .app-textarea::placeholder {
    color: #64748b;
}

.dark .app-input:focus,
.dark .app-select:focus,
.dark .app-textarea:focus {
    border-color: #60a5fa;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

/* Keep the public coach form within its grid column on narrow screens. */
.coach-registration-card,
.coach-registration-form,
.coach-registration-form > section,
.coach-registration-form .grid,
.coach-registration-form .grid > div {
    min-width: 0;
}

.coach-registration-form :where(input, select, textarea) {
    box-sizing: border-box;
    max-width: 100%;
}

.phone-number-fields {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto
        minmax(0, 1fr) auto
        minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    width: 100%;
}

.phone-number-input {
    min-width: 0;
    width: 100%;
}

/* File input (browser-rendered) */
.app-file {
    width: 100%;
    border-radius: var(--app-radius-sm);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
}

.app-file::file-selector-button {
    border: 0;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    margin-right: 0.75rem;
    cursor: pointer;
}

.app-file::file-selector-button:hover {
    background: rgba(37, 99, 235, 0.18);
}

.dark .app-file {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(71, 85, 105, 0.6);
    color: #cbd5e1;
}

.dark .app-file::file-selector-button {
    background: rgba(96, 165, 250, 0.15);
    color: #bfdbfe;
}

/* Field group container (the bordered slate-50/70 rounded sections used everywhere) */
.app-field-group {
    border-radius: var(--app-radius-lg);
    border: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.7);
    padding: 1.25rem;
}

.dark .app-field-group {
    border-color: rgba(71, 85, 105, 0.5);
    background: rgba(15, 23, 42, 0.45);
}

/* Drop zone (upload card) */
.app-dropzone {
    border-radius: var(--app-radius-md);
    border: 2px dashed #cbd5e1;
    background: rgba(248, 250, 252, 0.65);
    padding: 1.25rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    text-align: center;
}

.dark .app-dropzone {
    border-color: rgba(71, 85, 105, 0.7);
    background: rgba(15, 23, 42, 0.4);
}

.app-dropzone.dragover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.dark .app-dropzone.dragover {
    border-color: #60a5fa;
    background: rgba(37, 99, 235, 0.16);
}

/* --------------------------------------------------------------------------
   8. Tables
   -------------------------------------------------------------------------- */

.app-table-shell {
    overflow: hidden;
    border-radius: 2rem;
}

.app-table {
    width: 100%;
    text-align: left;
    font-size: 0.88rem;
    color: #475569;
}

.app-table thead th {
    background: rgba(248, 250, 252, 0.95);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(8px);
}

.dark .app-table thead th {
    background: rgba(2, 6, 23, 0.95);
    color: #94a3b8;
    border-color: rgba(51, 65, 85, 0.6);
}

.app-table tbody tr {
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    transition: background-color 0.15s ease;
}

.app-table tbody tr:last-child {
    border-bottom: 0;
}

.app-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.7);
}

.dark .app-table tbody tr {
    border-color: rgba(51, 65, 85, 0.6);
}

.dark .app-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.4);
}

.app-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   9. Modals / slide-overs
   -------------------------------------------------------------------------- */

.app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(6px);
    z-index: 50;
    display: flex;
    padding: 0;
}

@media (min-width: 640px) {
    .app-modal-overlay {
        padding: 1rem;
    }
}

.app-modal-overlay.hidden {
    display: none;
}

/* Side-mounted (slide-over) modal panel */
.app-modal-panel {
    background: #ffffff;
    width: 100%;
    max-width: 42rem;
    height: 100%;
    margin-left: auto;
    box-shadow: -32px 0 60px rgba(2, 6, 23, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
}

.dark .app-modal-panel {
    background: #0f172a;
}

@media (min-width: 640px) {
    .app-modal-panel {
        border-radius: var(--app-radius-lg);
        max-height: calc(100vh - 2rem);
    }
}

.app-modal-panel-narrow {
    max-width: 28rem;
}

/* Centered modal panel (used in admin_staff edit) */
.app-modal-overlay-centered {
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 640px) {
    .app-modal-overlay-centered {
        align-items: center;
    }
}

.app-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 64rem;
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
    border-radius: var(--app-radius-lg);
    box-shadow: 0 32px 64px rgba(2, 6, 23, 0.45);
}

.dark .app-modal-card {
    background: #0f172a;
}

@media (min-width: 640px) {
    .app-modal-card {
        max-height: calc(100vh - 3rem);
    }
}

.app-modal-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.dark .app-modal-header {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(51, 65, 85, 0.6);
}

.app-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

@media (min-width: 640px) {
    .app-modal-body,
    .app-modal-header {
        padding: 1.5rem;
    }
}

.app-modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.dark .app-modal-footer {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(51, 65, 85, 0.6);
}

@media (min-width: 640px) {
    .app-modal-footer {
        flex-direction: row;
        justify-content: flex-end;
        padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
    }
}

.app-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 9999px;
    background: rgba(241, 245, 249, 0.9);
    color: #475569;
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.dark .app-modal-close {
    background: rgba(51, 65, 85, 0.7);
    color: #cbd5e1;
}

.dark .app-modal-close:hover {
    background: rgba(71, 85, 105, 0.85);
    color: #f8fafc;
}

/* --------------------------------------------------------------------------
   10. Pagination
   -------------------------------------------------------------------------- */

.app-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    padding-bottom: 0.75rem;
}

.app-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-pagination-link:hover {
    background: #f8fafc;
    color: #0f172a;
}

.dark .app-pagination-link {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(71, 85, 105, 0.6);
    color: #cbd5e1;
}

.dark .app-pagination-link:hover {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
}

.app-pagination-link-active {
    background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.app-pagination-link-active:hover {
    color: #ffffff;
}

.app-pagination-ellipsis {
    color: #94a3b8;
    padding: 0 0.25rem;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   11. Bulk action bar (sticky bottom on listing pages)
   -------------------------------------------------------------------------- */

.app-bulk-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
    transform: translateY(110%);
    transition: transform 0.25s ease;
}

.dark .app-bulk-bar {
    background: rgba(2, 6, 23, 0.95);
    border-color: rgba(51, 65, 85, 0.6);
}

.app-bulk-bar.is-visible {
    transform: translateY(0);
}

.app-bulk-bar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    max-width: 80rem;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   12. Floating action / "back" button
   -------------------------------------------------------------------------- */

.app-fab {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(51, 65, 85, 0.55);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.app-fab:hover {
    transform: translate(-50%, -2px);
    background: rgba(15, 23, 42, 1);
}

.dark .app-fab {
    background: rgba(30, 41, 59, 0.92);
}

/* --------------------------------------------------------------------------
   13. Comment bubbles (admin / staff / share)
   -------------------------------------------------------------------------- */

.app-comment-row {
    display: flex;
    width: 100%;
    margin-bottom: 1rem;
}

.app-comment-row-admin {
    justify-content: flex-end;
}

.app-comment-row-coach {
    justify-content: flex-start;
}

.app-comment-meta {
    font-size: 0.65rem;
    color: #64748b;
    padding: 0 0.25rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dark .app-comment-meta {
    color: #94a3b8;
}

.app-comment-bubble {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.app-comment-bubble-admin .app-comment-content {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: 1rem 1rem 0.25rem 1rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.app-comment-bubble-coach .app-comment-content {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #ffffff;
    border-radius: 1rem 1rem 1rem 0.25rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.app-comment-bubble-admin {
    align-items: flex-end;
}

.app-comment-bubble-coach {
    align-items: flex-start;
}

.app-comment-attachments {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.app-comment-attachments a {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.72rem;
    text-decoration: underline;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.app-comment-attachments a:hover {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   14. Notice list cards (admin & staff list views)
   -------------------------------------------------------------------------- */

.app-notice-card {
    display: block;
    border-radius: 1.75rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(20px);
    padding: 1.1rem 1.15rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dark .app-notice-card {
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.42);
}

.app-notice-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}

.app-notice-card-unread {
    border-left: 6px solid #ef4444;
    box-shadow: 0 14px 32px rgba(239, 68, 68, 0.12), 0 0 0 1px rgba(252, 165, 165, 0.4);
}

.dark .app-notice-card-unread {
    box-shadow: 0 14px 32px rgba(239, 68, 68, 0.2), 0 0 0 1px rgba(127, 29, 29, 0.5);
}

.app-notice-card-read {
    border-left: 4px solid #cbd5e1;
    opacity: 0.85;
}

.dark .app-notice-card-read {
    border-left-color: #475569;
}

/* --------------------------------------------------------------------------
   15. iOS-style toggle switch (used in admin/staff headers)
   -------------------------------------------------------------------------- */

.toggle-checkbox:checked {
    right: 0;
    border-color: #60a5fa;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #2563eb;
}

.toggle-checkbox:checked + .toggle-label:after {
    transform: translateX(100%);
    border-color: white;
}

.toggle-label {
    width: 3rem;
    height: 1.5rem;
    background-color: #cbd5e1;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-label:after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark .toggle-label {
    background-color: #334155;
}

/* Standalone theme toggle button (for unauthenticated pages: index, share) */
.app-theme-toggle {
    position: fixed;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    right: 1.25rem;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--app-border);
    color: #475569;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.app-theme-toggle:hover {
    transform: translateY(-2px);
    background: #ffffff;
}

.dark .app-theme-toggle {
    background: rgba(15, 23, 42, 0.82);
    color: #cbd5e1;
}

.dark .app-theme-toggle:hover {
    background: rgba(15, 23, 42, 1);
}

.app-copyright-footer {
    position: fixed;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 35;
    width: min(42rem, calc(100vw - 8rem));
    transform: translateX(-50%);
    color: var(--app-text-faint);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.dark .app-copyright-footer {
    text-shadow: 0 1px 2px rgba(2, 6, 23, 0.9);
}

/* --------------------------------------------------------------------------
   16. Mobile / tablet refinements
   -------------------------------------------------------------------------- */

/* Prevent iOS zoom on focus by guaranteeing >=16px input font-size on small screens */
@media (max-width: 640px) {
    .app-input,
    .app-select,
    .app-textarea {
        font-size: 16px;
    }

    .coach-registration-card.coach-registration-card {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .coach-registration-form input:not([type="checkbox"]):not([type="radio"]),
    .coach-registration-form select,
    .coach-registration-form textarea {
        font-size: 16px;
    }

    .phone-number-input.phone-number-input {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
        font-size: 16px;
    }

    .app-button-primary,
    .app-button-secondary,
    .app-button-dark,
    .app-button-success,
    .app-button-warning,
    .app-button-danger,
    .app-button-ghost {
        width: 100%;
    }

    /* When buttons are wrapped in flex containers that should keep them inline,
       opt-out via .app-button-inline */
    .app-button-inline.app-button-primary,
    .app-button-inline.app-button-secondary,
    .app-button-inline.app-button-dark,
    .app-button-inline.app-button-success,
    .app-button-inline.app-button-warning,
    .app-button-inline.app-button-danger,
    .app-button-inline.app-button-ghost {
        width: auto;
    }
}

/* Respect environment safe areas on the page body */
.app-shell {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Login-page application title hierarchy */
.login-app-title {
    font-size: 4.5rem;
    line-height: 1;
}

.login-app-subtitle {
    font-size: 2.5rem;
    line-height: 1.2;
}

.login-app-title-mobile {
    font-size: 2.25rem;
}

.login-app-subtitle-mobile {
    margin-top: 0.2rem;
    font-size: 1.25rem;
}

/* Utility: visually hidden but accessible */
.app-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Keyboard-only shortcut shown when it receives focus. */
.app-skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
    transform: translateY(calc(-100% - 2rem));
    transition: transform 0.16s ease;
}

.app-skip-link:focus {
    transform: translateY(0);
}

/* Consistent keyboard focus indicator across shared and Tailwind controls. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #f59e0b !important;
    outline-offset: 3px !important;
}

.dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: #fbbf24 !important;
}

.toggle-checkbox:focus-visible + .toggle-label {
    outline: 3px solid #f59e0b !important;
    outline-offset: 3px !important;
}

.app-loading-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-loading-spinner {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 9999px;
    animation: app-loading-spin 0.7s linear infinite;
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .app-skip-link:focus {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   17. Public job listings / embeddable recruitment page
   -------------------------------------------------------------------------- */

.jobs-document,
.jobs-body {
    min-height: 100%;
    margin: 0;
    background: transparent !important;
}

.jobs-body {
    color: #0f172a;
}

.jobs-body *,
.jobs-body *::before,
.jobs-body *::after {
    box-sizing: border-box;
}

.jobs-page {
    width: 100%;
    padding: clamp(1rem, 4vw, 2.5rem);
}

.jobs-body--embed .jobs-page {
    padding: clamp(0.5rem, 2vw, 1rem);
}

.jobs-container {
    width: min(72rem, 100%);
    margin: 0 auto;
}

.jobs-public-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.98), rgba(2, 132, 199, 0.96) 55%, rgba(34, 211, 238, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 2rem;
    box-shadow: 0 20px 48px rgba(14, 116, 144, 0.2);
}

.jobs-eyebrow,
.jobs-card-label {
    margin: 0;
    font-family: var(--app-font-display);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.jobs-public-header .jobs-eyebrow {
    color: #dbeafe;
}

.jobs-public-title,
.jobs-embed-title {
    margin: 0.5rem 0 0;
    font-family: var(--app-font-display);
    font-weight: 800;
    line-height: 1.15;
}

.jobs-public-title {
    font-size: clamp(2rem, 7vw, 3.5rem);
}

.jobs-public-intro {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: #eff6ff;
    font-size: 0.95rem;
    line-height: 1.9;
}

.jobs-back-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 9999px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.jobs-back-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.jobs-embed-header {
    margin-bottom: 1rem;
    padding: 0.25rem 0.25rem 0;
}

.jobs-embed-header .jobs-eyebrow {
    color: #2563eb;
}

.jobs-embed-title {
    color: #0f172a;
    font-size: clamp(1.5rem, 6vw, 2.25rem);
}

.jobs-embed-intro {
    margin: 0.5rem 0 0;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.7;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
    gap: 1rem;
}

.jobs-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.5rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.jobs-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.jobs-card-label {
    color: #64748b;
}

.jobs-card-title {
    margin: 0.45rem 0 0;
    color: #0f172a;
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: 900;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.jobs-positions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    min-width: 5.25rem;
    padding: 0.65rem 0.8rem;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 1rem;
}

.jobs-positions span {
    font-size: 0.68rem;
    font-weight: 800;
}

.jobs-positions strong {
    margin-top: 0.1rem;
    font-size: 1.2rem;
    font-weight: 900;
}

.jobs-details {
    margin: 1.25rem 0 0;
}

.jobs-details > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.jobs-details dt {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.jobs-details dd {
    margin: 0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: right;
}

.jobs-description {
    margin-top: 1.1rem;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.jobs-apply-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    border-radius: 9999px;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.jobs-card-action {
    display: flex;
    margin-top: auto;
    padding-top: 1.25rem;
}

.jobs-card-action .jobs-apply-link {
    width: 100%;
}

.jobs-card-action--stacked {
    display: block;
}

.jobs-application-form {
    width: 100%;
}

.jobs-application-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.jobs-application-form label span {
    color: #64748b;
    font-weight: 500;
}

.jobs-application-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 5.5rem;
    padding: 0.8rem 0.9rem;
    color: #0f172a;
    font: inherit;
    font-size: 0.86rem;
    line-height: 1.6;
    resize: vertical;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
}

.jobs-application-form textarea:focus {
    border-color: #2563eb;
    outline: 3px solid rgba(37, 99, 235, 0.14);
}

.jobs-apply-button {
    width: 100%;
    margin-top: 0.75rem;
    border: 0;
    cursor: pointer;
}

.jobs-application-state {
    width: 100%;
    padding: 0.9rem 1rem;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.6;
    text-align: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
}

.jobs-application-state--active {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.jobs-application-state--pending {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}

.jobs-decision-comment {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    padding: 0.8rem 0.9rem;
    color: #9f1239;
    font-size: 0.78rem;
    line-height: 1.6;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 1rem;
}

.jobs-apply-link:hover {
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.jobs-back-link:focus-visible,
.jobs-apply-link:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}

.jobs-empty-state {
    padding: clamp(2rem, 7vw, 4rem) 1.5rem;
    color: #475569;
    text-align: center;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.5rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.jobs-empty-state h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.3rem;
    font-weight: 900;
}

.jobs-empty-state p {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.staff-jobs-listing .jobs-container {
    width: 100%;
}

.dark .staff-jobs-listing .jobs-card,
.dark .staff-jobs-listing .jobs-empty-state {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(71, 85, 105, 0.68);
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.28);
}

.dark .staff-jobs-listing .jobs-card-title,
.dark .staff-jobs-listing .jobs-details dd,
.dark .staff-jobs-listing .jobs-empty-state h2 {
    color: #f8fafc;
}

.dark .staff-jobs-listing .jobs-card-label,
.dark .staff-jobs-listing .jobs-details dt,
.dark .staff-jobs-listing .jobs-description,
.dark .staff-jobs-listing .jobs-empty-state {
    color: #cbd5e1;
}

.dark .staff-jobs-listing .jobs-details > div {
    border-color: #334155;
}

.dark .staff-jobs-listing .jobs-application-form label {
    color: #e2e8f0;
}

.dark .staff-jobs-listing .jobs-application-form label span {
    color: #94a3b8;
}

.dark .staff-jobs-listing .jobs-application-form textarea {
    color: #f8fafc;
    background: #1e293b;
    border-color: #475569;
}

.dark .staff-jobs-listing .jobs-application-state {
    color: #cbd5e1;
    background: #1e293b;
    border-color: #475569;
}

.dark .staff-jobs-listing .jobs-application-state--active {
    color: #a7f3d0;
    background: rgba(6, 78, 59, 0.35);
    border-color: #047857;
}

.dark .staff-jobs-listing .jobs-application-state--pending {
    color: #fde68a;
    background: rgba(120, 53, 15, 0.35);
    border-color: #b45309;
}

.dark .staff-jobs-listing .jobs-decision-comment {
    color: #fecdd3;
    background: rgba(136, 19, 55, 0.3);
    border-color: #be123c;
}

.activity-details-summary {
    list-style: none;
}

.activity-details-summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 640px) {
    .jobs-public-header {
        align-items: stretch;
        flex-direction: column;
        gap: 1.25rem;
        border-radius: 1.5rem;
    }

    .jobs-back-link {
        align-self: flex-start;
    }

    .jobs-card-heading {
        gap: 0.75rem;
    }

    .jobs-positions {
        min-width: 4.75rem;
        padding-right: 0.6rem;
        padding-left: 0.6rem;
    }
}
