:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --accent: #2563eb;
    --accent-soft: #e0e7ff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

header.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover,
.back-link:focus-visible {
    text-decoration: underline;
}

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.card + .card,
.card + .table-wrapper,
.table-wrapper + .card {
    margin-top: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
    align-items: end;
    margin-top: 12px;
}

.form-grid label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

input,
select,
button,
textarea,
.form-grid input,
.form-grid select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
}

button,
.button-link {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

button:hover,
button:focus-visible,
.button-link:hover,
.button-link:focus-visible {
    background: #1d4ed8;
}

button:active,
.button-link:active {
    transform: translateY(1px);
}

.button-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.table-wrapper {
    background: var(--card);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

th,
td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background: var(--accent-soft);
    color: #1f2937;
    font-weight: 700;
}

.table-actions a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.table-actions a + a {
    margin-left: 8px;
}

.helper-text {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.list-inline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    background: var(--accent-soft);
    color: #1d4ed8;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.menu-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border-radius: 12px;
    background: #10b981;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.2);
}

.menu-grid a:hover,
.menu-grid a:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(16, 185, 129, 0.28);
}

.section-heading {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .page {
        padding: 18px 14px 28px;
    }

    table {
        min-width: 520px;
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .table-actions {
        white-space: nowrap;
    }
}
