:root {
    --background: #f3f7f6;
    --surface: #ffffff;
    --surface-soft: #edf6f3;
    --primary: #176b5b;
    --primary-dark: #0f5145;
    --primary-light: #d9ede8;
    --text: #20312e;
    --muted: #687874;
    --border: #d9e5e2;
    --danger-bg: #fff0f0;
    --danger-text: #a72b2b;
    --shadow: 0 18px 50px rgba(28, 65, 57, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

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

a {
    color: inherit;
}

/* ログイン画面 */

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at top left,
            rgba(23, 107, 91, 0.14),
            transparent 35%
        ),
        linear-gradient(145deg, #f7faf9, #e8f2ef);
}

.login-container {
    width: 100%;
    max-width: 460px;
}

.login-card {
    padding: 44px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 30px;
    line-height: 1.4;
}

.login-description {
    margin: 0 0 28px;
    color: var(--muted);
    line-height: 1.8;
}

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

.login-form label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    font-size: 16px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 107, 91, 0.12);
}

.login-form button {
    margin-top: 14px;
    padding: 15px;
    color: #ffffff;
    background: var(--primary);
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition:
        background 0.2s,
        transform 0.2s;
}

.login-form button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.alert {
    margin: 0 0 20px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.alert-error {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.security-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* ログイン後 */

.app-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 22px max(28px, 5vw);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 18px rgba(28, 65, 57, 0.04);
}

.header-title h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
}

.header-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.header-account {
    display: flex;
    align-items: center;
    gap: 20px;
}

.account-info {
    display: grid;
    gap: 3px;
    text-align: right;
}

.account-label {
    color: var(--muted);
    font-size: 11px;
}

.account-info strong {
    font-size: 14px;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    color: var(--primary);
    background: var(--surface-soft);
    border: 1px solid var(--primary-light);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.2s,
        color 0.2s;
}

.logout-link:hover {
    color: #ffffff;
    background: var(--primary);
}

.dashboard {
    width: min(1160px, calc(100% - 40px));
    margin: 42px auto 64px;
}

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 38px 40px;
    color: #ffffff;
    background:
        linear-gradient(
            125deg,
            rgba(23, 107, 91, 0.98),
            rgba(15, 81, 69, 0.96)
        );
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.section-label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.welcome-panel .section-label {
    color: rgba(255, 255, 255, 0.72);
}

.welcome-panel h2 {
    margin: 0 0 12px;
    font-size: 29px;
    line-height: 1.4;
}

.welcome-panel p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.8;
}

.workflow-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.workflow-summary b {
    color: rgba(255, 255, 255, 0.55);
}

.dashboard-section {
    margin-top: 38px;
}

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

.section-heading h2 {
    margin: 0;
    font-size: 24px;
}

.section-heading p {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 14px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.menu-card {
    position: relative;
    display: flex;
    min-height: 270px;
    padding: 26px;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(28, 65, 57, 0.05);
    text-decoration: none;
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        border-color 0.2s;
}

a.menu-card:hover {
    transform: translateY(-3px);
    border-color: #9fc6bd;
    box-shadow: 0 16px 42px rgba(28, 65, 57, 0.11);
}

.menu-card-primary {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--surface-soft)
        );
    border-color: #bedbd4;
}

.menu-card-disabled {
    cursor: default;
    opacity: 0.75;
}

.menu-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-number {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.menu-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    color: var(--muted);
    background: #f0f4f3;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-ready {
    color: var(--primary-dark);
    background: var(--primary-light);
}

.menu-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-top: 25px;
    color: var(--primary);
    background: var(--surface-soft);
    border: 1px solid var(--primary-light);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
}

.menu-card h3 {
    margin: 20px 0 10px;
    font-size: 21px;
}

.menu-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.menu-action {
    display: block;
    margin-top: auto;
    padding-top: 22px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.menu-card-disabled .menu-action {
    color: var(--muted);
}

.app-footer {
    margin-top: auto;
    padding: 22px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 12px;
    text-align: center;
}

.app-footer p {
    margin: 0;
}

@media (max-width: 900px) {
    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .workflow-summary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .login-card {
        padding: 30px 24px;
    }

    .login-card h1 {
        font-size: 25px;
    }

    .app-header {
        align-items: flex-start;
        padding: 19px 20px;
        flex-direction: column;
    }

    .header-account {
        width: 100%;
        justify-content: space-between;
    }

    .account-info {
        text-align: left;
    }

    .dashboard {
        width: calc(100% - 24px);
        margin: 24px auto 40px;
    }

    .welcome-panel {
        padding: 28px 24px;
    }

    .welcome-panel h2 {
        font-size: 24px;
    }

    .workflow-summary {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .workflow-summary b {
        transform: rotate(90deg);
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.welcome-panel-compact {
    padding-top: 30px;
    padding-bottom: 30px;
}

.menu-icon-wide {
    width: 72px;
}
