:root {
    color-scheme: light;
    --background: #f4f5f7;
    --surface: #ffffff;
    --surface-subtle: #f8f8fa;
    --text: #21212a;
    --text-muted: #626270;
    --border: #d0cedd;
    --border-subtle: #e8e6ee;
    --accent: #35315f;
    --accent-strong: #2b2850;
    --accent-secondary: #65618e;
    --accent-soft: #f0f0f6;
    --header-background: #1e1c34;
    --header-text-muted: rgba(255, 255, 255, 0.72);
    --header-text-strong: rgba(255, 255, 255, 0.82);
    --focus-ring: rgba(53, 49, 95, 0.18);
    --error-text: #8a2828;
    --error-border: #e4b7b7;
    --error-soft: #fff4f4;
    --shadow-subtle: 0 3px 12px rgba(30, 28, 52, 0.04);
    --shadow: 0 12px 30px rgba(30, 28, 52, 0.08);
    --shadow-hover: 0 16px 36px rgba(30, 28, 52, 0.13);
    --radius-large: 18px;
    --radius-medium: 12px;
    --content-width: 1080px;
}

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

html {
    min-width: 320px;
    scrollbar-gutter: stable;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--accent-strong);
    border-radius: 8px;
    transform: translateY(-160%);
}

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

.site-header {
    color: #ffffff;
    background: var(--header-background);
}

.site-header__inner,
.primary-nav__inner,
.page-shell,
.site-footer__inner {
    width: min(calc(100% - 40px), var(--content-width));
    margin-inline: auto;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 24px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.site-brand__logo {
    display: block;
    width: auto;
    height: 34px;
}

.site-brand__name,
.site-brand__admin {
    font-size: 1.25rem;
    font-weight: 750;
    letter-spacing: 0.03em;
}

.site-brand__label {
    color: var(--header-text-muted);
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-header__environment {
    color: var(--header-text-strong);
    font-size: 0.8rem;
}

.primary-nav {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-subtle);
}

.primary-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.primary-nav__list {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    gap: 4px;
    padding-block: 9px;
    padding-inline: 0;
    list-style: none;
}

.primary-nav a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    color: var(--accent);
    background: var(--accent-soft);
}

.primary-nav a[aria-current="page"] {
    color: #ffffff;
    background: var(--accent);
}

.primary-nav a[aria-current="page"]:hover,
.primary-nav a[aria-current="page"]:focus-visible {
    color: #ffffff;
    background: var(--accent-strong);
}

.admin-account {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
}

.admin-account__name {
    max-width: 180px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-account form {
    margin: 0;
}

.logout-button,
.button {
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.logout-button {
    padding: 8px 10px;
    color: var(--text-muted);
    background: var(--surface-subtle);
    font-size: 0.78rem;
}

.logout-button:hover,
.logout-button:focus-visible {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.login-shell {
    display: grid;
    width: min(calc(100% - 40px), 480px);
    min-height: calc(100vh - 174px);
    margin-inline: auto;
    padding-block: 54px;
    place-items: center;
}

.login-card {
    width: 100%;
    padding: clamp(26px, 6vw, 40px);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 0;
    line-height: 1.3;
    font-size: clamp(1.65rem, 5vw, 2.1rem);
}

.login-card__lead {
    margin: 10px 0 26px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.form-error {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--error-border);
    border-radius: 9px;
    color: var(--error-text);
    background: var(--error-soft);
    font-size: 0.88rem;
}

.form-success {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--accent-secondary);
    border-radius: 9px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 0.88rem;
}

.login-form {
    display: grid;
    gap: 20px;
}

.form-field {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
}

.form-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
    outline: none;
}

.form-field small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.button {
    min-height: 46px;
    padding: 10px 18px;
}

.button--primary {
    color: #ffffff;
    background: var(--accent);
}

.button--primary:hover,
.button--primary:focus-visible {
    background: var(--accent-strong);
}

.button--secondary {
    border: 1px solid var(--accent-secondary);
    color: var(--accent);
    background: var(--surface);
}

.button--secondary:hover,
.button--secondary:focus-visible {
    border-color: var(--accent-secondary);
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.button--link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.text-link {
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--accent-strong);
}

.page-shell {
    padding-block: 42px 64px;
}

.page-heading {
    margin-bottom: 38px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent-secondary);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.page-heading h1,
.section-heading h2,
.placeholder-panel h2,
.dashboard-card h3 {
    line-height: 1.3;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.65rem);
    letter-spacing: -0.025em;
}

.page-heading > p:last-child {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--text-muted);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.section-heading > p {
    max-width: 460px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: right;
}

.card-grid {
    display: grid;
    gap: 18px;
}

.card-grid--services,
.card-grid--support {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-card {
    position: relative;
    display: flex;
    min-height: 205px;
    padding: 25px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-card:hover,
.dashboard-card:focus-visible {
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-hover);
    outline: none;
    transform: translateY(-2px);
}

.dashboard-card--accent {
    border-color: var(--accent-secondary);
    background: linear-gradient(145deg, #ffffff 20%, var(--accent-soft) 100%);
}

.dashboard-card--muted {
    background: var(--surface-subtle);
}

.card-code,
.status-badge {
    align-self: flex-start;
    padding: 4px 9px;
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent-secondary);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.dashboard-card h3 {
    margin: 18px 0 7px;
    font-size: 1.3rem;
}

.dashboard-card p {
    margin: 0 0 22px;
    color: var(--text-muted);
}

.card-link {
    margin-top: auto;
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 750;
}

.dashboard-card:hover .card-link,
.dashboard-card:focus-visible .card-link {
    color: var(--accent-strong);
}

.support-section {
    margin-top: 48px;
    padding-top: 38px;
    border-top: 1px solid var(--border);
}

.placeholder-panel {
    max-width: 820px;
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.placeholder-panel--accent {
    border-color: var(--accent-secondary);
    background: linear-gradient(145deg, #ffffff 20%, var(--accent-soft) 100%);
}

.status-badge--muted {
    color: var(--text-muted);
    background: var(--background);
    box-shadow: inset 0 0 0 1px var(--border);
}

.placeholder-panel h2 {
    margin: 18px 0 14px;
    font-size: 1.35rem;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding: 11px 12px 11px 34px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--surface-subtle);
}

.feature-list li::before {
    position: absolute;
    top: 14px;
    left: 13px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    content: "";
}

.placeholder-note {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.system-planned-panel {
    margin-top: 28px;
}

.admin-panel,
.admin-form-panel {
    padding: clamp(22px, 4vw, 32px);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-section-heading {
    align-items: center;
}

.admin-section-heading .button {
    flex: 0 0 auto;
}

.admin-section-description {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
}

.admin-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
    padding: 17px 22px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th + th,
.admin-table td + td {
    border-left: 1px solid var(--border-subtle);
}

.admin-table th {
    color: var(--text-muted);
    background: var(--accent-soft);
    font-size: 0.8rem;
}

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

.admin-table__display-name {
    width: 24%;
}

.admin-table__login-id {
    width: 20%;
    white-space: nowrap;
}

.admin-table__status {
    width: 12%;
    white-space: nowrap;
}

.admin-table__datetime {
    width: 22%;
    white-space: nowrap;
}

.admin-table code {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
}

.admin-empty-state {
    margin: 0;
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-medium);
    color: var(--text-muted);
    text-align: center;
}

.admin-form-panel {
    max-width: 760px;
}

.admin-form {
    display: grid;
    gap: 20px;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.site-footer {
    padding-block: 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 760px) {
    .site-header__inner,
    .primary-nav__inner,
    .page-shell,
    .site-footer__inner {
        width: min(calc(100% - 28px), var(--content-width));
    }

    .site-header__inner {
        min-height: 64px;
    }

    .site-header__environment,
    .site-brand__label {
        display: none;
    }

    .site-brand__logo {
        height: 29px;
    }

    .primary-nav__inner {
        display: block;
        padding-block: 9px 12px;
    }

    .primary-nav__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding-block: 0;
    }

    .primary-nav a {
        padding: 9px 10px;
        font-size: 0.8rem;
        text-align: center;
    }

    .admin-account {
        justify-content: space-between;
        margin-top: 9px;
        padding-top: 9px;
        border-top: 1px solid var(--border);
    }

    .admin-account__name {
        max-width: 190px;
    }

    .login-shell {
        width: min(calc(100% - 28px), 480px);
        min-height: calc(100vh - 152px);
        padding-block: 34px;
    }

    .page-shell {
        padding-block: 30px 48px;
    }

    .page-heading {
        margin-bottom: 28px;
    }

    .section-heading {
        display: block;
    }

    .section-heading > p {
        margin-top: 8px;
        text-align: left;
    }

    .admin-section-heading .button,
    .admin-form-actions .button {
        width: 100%;
    }

    .admin-section-heading .button {
        margin-top: 14px;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px 13px;
    }

    .card-grid--services,
    .card-grid--support,
    .feature-list {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 180px;
        padding: 22px;
    }

    .support-section {
        margin-top: 38px;
        padding-top: 30px;
    }

    .site-footer__inner {
        display: block;
    }

    .site-footer p + p {
        margin-top: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
