/* ========================================
   KENBA 共通デザイン
   ======================================== */

:root {
    --kenba-primary: #173e35;
    --kenba-primary-hover: #245748;
    --kenba-accent: #d8a84b;
    --kenba-bg: #f5f7f6;
    --kenba-white: #ffffff;
    --kenba-text: #26332e;
    --kenba-muted: #697771;
    --kenba-border: #dce4df;
    --kenba-danger: #b63c3c;
    --kenba-radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--kenba-bg);
    color: var(--kenba-text);
    font-family:
        "Noto Sans JP",
        "Yu Gothic",
        "Meiryo",
        sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

h1,
h2,
h3 {
    color: var(--kenba-primary);
    line-height: 1.4;
}

h1 {
    font-size: 28px;
}

a {
    color: var(--kenba-primary);
}

a:hover {
    color: var(--kenba-primary-hover);
}

button,
input[type="submit"] {
    background: var(--kenba-primary);
    color: var(--kenba-white);
    border: none;
    border-radius: var(--kenba-radius);
    padding: 10px 18px;
    font: inherit;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
    background: var(--kenba-primary-hover);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--kenba-border);
    border-radius: var(--kenba-radius);
    background: var(--kenba-white);
    color: var(--kenba-text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--kenba-accent);
    outline-offset: 2px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--kenba-white);
}

th,
td {
    padding: 12px;
    border: 1px solid var(--kenba-border);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #e8efeb;
    color: var(--kenba-primary);
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 23px;
    }

    th,
    td {
        padding: 8px;
    }

    button,
    input[type="submit"] {
        min-height: 44px;
    }
}


/* ========================================
   ログイン・認証画面
   ======================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
}

.auth-brand p {
    color: var(--kenba-muted);
    font-size: 14px;
    margin: 0;
}

.auth-card {
    background: var(--kenba-white);
    border: 1px solid var(--kenba-border);
    border-radius: 14px;
    padding: 36px;
    box-shadow: 0 12px 36px rgba(23, 62, 53, 0.08);
}

.auth-card h2 {
    margin: 0 0 28px;
    text-align: center;
    font-size: 24px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-card .form-group input {
    display: block;
    width: 100%;
}

.auth-submit {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 13px 18px;
    font-weight: 700;
}

.auth-register {
    margin: 26px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--kenba-muted);
}

.auth-register a {
    font-weight: 700;
}

.auth-error,
.auth-success {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-error {
    background: #fff0f0;
    color: #a52e2e;
}

.auth-success {
    background: #e8f4ec;
    color: #246b45;
}

/* スマートフォン対応 */
@media (max-width: 768px) {
    .auth-page {
        padding: 24px 16px;
    }

    .auth-brand h1 {
        font-size: 36px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-card h2 {
        font-size: 22px;
    }
}

/* 共通ヘッダー */
.site-header {
    background: var(--kenba-primary);
    color: #ffffff;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-logo {
    color: #ffffff;
    text-decoration: none;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.site-logo:hover {
    color: #ffffff;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-header-user {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.header-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 7px 12px;
    white-space: nowrap;
}

.header-logout:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .site-header-inner {
        padding: 12px 16px;
    }

    .site-logo {
        font-size: 22px;
    }

    .site-header-user {
        display: none;
    }
}

/* ダッシュボード共通レイアウト */
.dashboard-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 24px 16px;
    }
}

/* ホーム画面：検索メニュー */
.dashboard-menu {
    margin-top: 32px;
    margin-bottom: 40px;
}

.dashboard-menu h2 {
    margin-bottom: 20px;
    font-size: 22px;
}

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

.dashboard-menu-card {
    display: block;
    padding: 28px 24px;
    background: var(--kenba-white);
    border: 1px solid var(--kenba-border);
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(23, 62, 53, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(23, 62, 53, 0.12);
}

.dashboard-menu-card h3 {
    margin: 0 0 12px;
    font-size: 19px;
}

.dashboard-menu-card p {
    margin: 0 0 24px;
    color: var(--kenba-muted);
    font-size: 14px;
}

.dashboard-menu-card span {
    color: var(--kenba-primary);
    font-weight: 700;
    font-size: 14px;
}

/* スマートフォン対応 */
@media (max-width: 768px) {
    .dashboard-menu {
        margin-top: 24px;
    }

    .dashboard-menu h2 {
        font-size: 19px;
    }

    .dashboard-menu-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .dashboard-menu-card {
        padding: 22px 20px;
    }
}

/* ホーム画面：アカウント情報 */
.account-section {
    margin-top: 40px;
}

.account-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

.account-card {
    background: var(--kenba-white);
    border: 1px solid var(--kenba-border);
    border-radius: 12px;
    padding: 24px;
}

.account-card p {
    margin: 0 0 14px;
}

.account-card p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .account-section h2 {
        font-size: 19px;
    }

    .account-card {
        padding: 20px;
    }
}

/* SCR-019：ダッシュボードのサイドバー */
.dashboard-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--kenba-white);
    border: none;
    border-right: 1px solid var(--kenba-border);
    border-radius: 0;
    padding: 24px 16px;
    margin: 0;
}

.sidebar-title {
    font-size: 16px;
    margin: 0 0 16px;
    padding: 0 12px;
}

.dashboard-sidebar a {
    display: block;
    padding: 12px;
    border-radius: 8px;
    color: var(--kenba-text);
    text-decoration: none;
    font-size: 14px;
}

.dashboard-sidebar a:hover {
    background: #edf3ef;
    color: var(--kenba-primary);
}

.dashboard-sidebar a[aria-current="page"] {
    background: #e5efe9;
    color: var(--kenba-primary);
    font-weight: 700;
}

.dashboard-sidebar hr {
    border: 0;
    border-top: 1px solid var(--kenba-border);
    margin: 12px 0;
}

/* スマートフォン */
@media (max-width: 768px) {
    .dashboard-sidebar {
        width: 100%;
        padding: 16px;
    }
}

/* SCR-019：ダッシュボードの2列レイアウト */
.dashboard-layout {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: calc(100vh - 90px);
}

.dashboard-layout .dashboard-sidebar {
    width: 240px;
    flex: 0 0 240px;
    margin-bottom: 0;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
}

.dashboard-main>h1 {
    margin-top: 0;
}

/* メインエリア内のカードを画面幅に合わせて調整 */
.dashboard-main .dashboard-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* スマートフォン対応 */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
        gap: 20px;
    }

    .dashboard-layout .dashboard-sidebar {
        width: 100%;
        flex: none;
    }

    .dashboard-main {
        width: 100%;
    }

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

/* SCR-019：白い共通ヘッダー */
.site-header {
    background: #ffffff;
    color: var(--kenba-text);
    border-bottom: 1px solid var(--kenba-border);
}

.site-header-inner {
    max-width: none;
    padding: 12px 24px;
}

.site-logo {
    color: var(--kenba-primary);
}

.site-logo:hover {
    color: var(--kenba-primary);
}

.site-header-search {
    flex: 1;
    max-width: 520px;
    margin: 0 24px;
}

.site-header-search form {
    display: flex;
    gap: 8px;
}

.site-header-search input[type="search"] {
    width: 100%;
    min-width: 0;
    background: #f0f3f5;
}

.site-header-search button {
    white-space: nowrap;
}

.site-header-actions {
    flex-shrink: 0;
}

.header-icon-link {
    color: var(--kenba-primary);
    text-decoration: none;
    font-size: 22px;
}

.header-logout {
    color: var(--kenba-primary);
    border-color: var(--kenba-border);
}

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

@media (max-width: 768px) {
    .site-header-inner {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .site-header-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        margin: 8px 0 0;
    }

    .site-header-actions {
        gap: 10px;
    }
}

/* SCR-019：ダッシュボードのメインビジュアル */
.dashboard-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 220px;
    padding: 32px 40px;
    margin: -32px -28px 28px;
    overflow: hidden;
    background-color: #e5eeea;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0.96) 0%,
            rgba(255, 255, 255, 0.80) 48%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: cover;
    background-position: center;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.dashboard-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.dashboard-hero h2 {
    margin: 0 0 14px;
    font-size: 19px;
}

.dashboard-hero p {
    margin: 0;
    color: #52645c;
    font-size: 14px;
}

@media (max-width: 768px) {
    .dashboard-hero {
        min-height: 200px;
        padding: 28px 20px;
        margin: -24px -16px 24px;
    }

    .dashboard-hero h1 {
        font-size: 23px;
    }

    .dashboard-hero h2 {
        font-size: 17px;
    }
}

/* KENBA ダッシュボード：メインビジュアル */
.dashboard-hero {
    background-color: #e5eeea;
    background-image:
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.96) 0%,
            rgba(255, 255, 255, 0.82) 38%,
            rgba(255, 255, 255, 0.05) 100%),
        url('/images/dashboard-construction.png');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* STEP 188：メインビジュアルの重なりを修正 */
.dashboard-hero {
    margin: 0 0 28px 0;
}

/* STEP 189：ダッシュボード本文の余白 */
.dashboard-main {
    padding: 0 28px 32px;
}

/* 写真は左右いっぱいに表示 */
.dashboard-hero {
    margin: 0 -28px 28px;
}

/* スマートフォン用 */
@media (max-width: 768px) {
    .dashboard-main {
        padding: 0 16px 24px;
    }

    .dashboard-hero {
        margin: 0 -16px 24px;
    }
}

/* STEP 193：ダッシュボード統計カード */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

/* タブレット */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* スマートフォン */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.dashboard-stat-card {
    background: #ffffff;
    border: 1px solid var(--kenba-border);
    border-radius: 12px;
    padding: 24px;
}

.dashboard-stat-card p {
    margin: 0 0 12px;
    color: #52645c;
    font-size: 14px;
}

.dashboard-stat-card strong {
    color: var(--kenba-primary);
    font-size: 32px;
}

.dashboard-stat-card span {
    margin-left: 4px;
    color: #52645c;
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* STEP 202：ダッシュボード新着情報 */

.dashboard-latest {
    background: #ffffff;
    border: 1px solid var(--kenba-border);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 32px;
}

.dashboard-latest h2 {
    font-size: 22px;
    margin: 0 0 20px;
    color: var(--kenba-primary);
}

.dashboard-latest h2:not(:first-child) {
    margin-top: 36px;
}

.dashboard-latest>div {
    padding: 14px 0;
}

.dashboard-latest>div a {
    color: var(--kenba-primary);
    font-size: 17px;
    text-decoration: none;
}

.dashboard-latest>div a:hover {
    text-decoration: underline;
}

.dashboard-latest>div p {
    color: #64746d;
    font-size: 14px;
    margin: 8px 0 0;
}

.dashboard-latest hr {
    border: 0;
    border-top: 1px solid var(--kenba-border);
    margin: 16px 0 0;
}

.dashboard-latest>p a {
    color: var(--kenba-primary);
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 768px) {
    .dashboard-latest {
        padding: 18px;
    }

    .dashboard-latest h2 {
        font-size: 19px;
    }
}

/* STEP 203：ダッシュボード2カラム */

.dashboard-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
    gap: 24px;
    align-items: start;
}

.dashboard-content-grid>* {
    min-width: 0;
}

.dashboard-content-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-content-grid .dashboard-latest {
    margin-bottom: 0;
}

.dashboard-content-side .account-section {
    margin: 0;
}

@media (max-width: 1100px) {
    .dashboard-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-content-grid {
        gap: 16px;
    }
}

/* STEP 207：ダッシュボード通知カード */

.dashboard-notifications {
    background: #ffffff;
    border: 1px solid var(--kenba-border);
    border-radius: 14px;
    padding: 24px;
    min-width: 0;
}

.dashboard-notifications h2 {
    color: var(--kenba-primary);
    font-size: 20px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.dashboard-notifications h2 span {
    font-size: 14px;
    font-weight: 500;
}

.dashboard-notifications>div {
    padding: 12px 0;
}

.dashboard-notifications>div p {
    margin: 0 0 10px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.dashboard-notifications>div p:first-child {
    font-size: 14px;
}

.dashboard-notifications>div p:nth-child(2) {
    color: #64746d;
    font-size: 13px;
}

.dashboard-notifications hr {
    border: 0;
    border-top: 1px solid var(--kenba-border);
    margin: 14px 0 0;
}

.dashboard-notifications>p:last-child {
    margin: 16px 0 0;
}

.dashboard-notifications>p a {
    color: var(--kenba-primary);
    font-weight: 600;
    text-decoration: none;
}

.dashboard-notifications>p a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .dashboard-notifications {
        padding: 18px;
    }
}

/* STEP 209：スマートフォン用ハンバーガーメニュー */

/* PCでは従来どおりサイドバーを表示 */
.dashboard-mobile-menu {
    width: 240px;
    flex: 0 0 240px;
    margin: 0;
    padding: 0;
    border-right: 1px solid var(--kenba-border);
    background: #ffffff;
}

.dashboard-menu-toggle {
    display: none;
}

/* detailsが閉じていてもPCではメニューを表示 */
.dashboard-mobile-menu>.dashboard-sidebar {
    display: block;
    width: 100%;
    border: none;
}

/* スマートフォン */
@media (max-width: 768px) {

    .dashboard-layout {
        display: block;
    }

    .dashboard-mobile-menu {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--kenba-border);
    }

    .dashboard-menu-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 16px;
        font-size: 16px;
        font-weight: 700;
        color: var(--kenba-primary);
        cursor: pointer;
        list-style: none;
    }

    .dashboard-menu-toggle::-webkit-details-marker {
        display: none;
    }

    .dashboard-menu-toggle::marker {
        content: "";
    }

    .menu-icon {
        font-size: 22px;
    }

    /* 閉じているときはメニューを非表示 */
    .dashboard-mobile-menu:not([open])>.dashboard-sidebar {
        display: none;
    }

    /* 開いたときだけメニューを表示 */
    .dashboard-mobile-menu[open]>.dashboard-sidebar {
        display: block;
        width: 100%;
        padding: 12px 16px 20px;
        border: none;
        border-radius: 0;
    }
}

/* STEP 211：PCでサイドメニューを常時表示 */

@media (min-width: 769px) {

    .dashboard-mobile-menu:not([open])>.dashboard-sidebar {
        display: block !important;
    }

    .dashboard-mobile-menu>.dashboard-sidebar {
        display: block !important;
    }
}

/* STEP 212：PC・スマホ共通メニューの修正 */

/* PCではサイドバーを常時表示 */
.dashboard-mobile-menu {
    width: 240px;
    flex: 0 0 240px;
    background: #fff;
    border-right: 1px solid var(--kenba-border);
}

.dashboard-mobile-menu .dashboard-menu-toggle {
    display: none;
}

.dashboard-mobile-menu .dashboard-sidebar {
    display: block !important;
    width: 100%;
    border: none;
}

/* スマートフォン */
@media (max-width: 768px) {

    .dashboard-mobile-menu {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--kenba-border);
    }

    .dashboard-mobile-menu .dashboard-menu-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 16px;
        border: none;
        background: #fff;
        color: var(--kenba-primary);
        font-size: 16px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }

    .dashboard-mobile-menu .dashboard-sidebar {
        display: none !important;
    }

    .dashboard-mobile-menu .dashboard-sidebar.is-open {
        display: block !important;
        padding: 12px 16px 20px;
    }
}

/* STEP 214：統計カードの文字と数字 */

.dashboard-stat-card {
    text-align: center;
}

.dashboard-stat-card p {
    color: #173e35;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 18px;
}

.dashboard-stat-card strong {
    color: #173e35;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
}

.dashboard-stat-card span {
    font-size: 16px;
}

/* STEP 215：統計カードのアイコン・前月比 */

.dashboard-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 14px;
}

.dashboard-stat-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e6f3ed;
    color: #17654b;
    font-size: 27px;
    line-height: 1;
}

.dashboard-stat-card p {
    margin: 2px 0 0;
    color: #173e35;
    font-size: 19px;
    font-weight: 700;
    text-align: center;
}

.dashboard-stat-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.dashboard-stat-value strong {
    color: #173e35;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
}

.dashboard-stat-value span {
    color: #173e35;
    font-size: 16px;
    margin: 0;
}

.dashboard-stat-change {
    margin-top: 4px;
    color: #778780;
    font-size: 12px;
    text-align: center;
}

/* STEP 216：統計アイコンの中央配置 */

.dashboard-stat-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.dashboard-stat-icon svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* STEP 218：統計カードのSVGサイズを統一 */

.dashboard-stat-card .dashboard-stat-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 50%;
    background: #e6f3ed;
    color: #17654b;
}

.dashboard-stat-card .dashboard-stat-icon svg {
    display: block;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    max-width: 28px;
    min-height: 28px;
    max-height: 28px;
}

/* STEP 223：サイドメニューのSVGアイコン */

.dashboard-sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-sidebar a svg {
    display: block;
    width: 21px;
    height: 21px;
    min-width: 21px;
    flex-shrink: 0;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-sidebar a span {
    display: block;
    min-width: 0;
}

/* ========================================
   ダッシュボード：マイプロフィール
======================================== */

.profile-photo-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 20px;
}

.profile-photo,
.profile-photo-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
}

.profile-photo {
    display: block;
    object-fit: cover;
    border: 4px solid #e8f2ec;
}

.profile-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f2ec;
    color: #173e35;
    border: 4px solid #e8f2ec;
}

.profile-photo-placeholder span {
    font-size: 48px;
    line-height: 1;
}

.account-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.account-card form label {
    font-size: 14px;
    font-weight: 600;
    color: #173e35;
}

.account-card input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 13px;
}

.account-card form button {
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: #173e35;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.account-card form button:hover {
    background: #245b4d;
}

@media (max-width: 768px) {

    .profile-photo,
    .profile-photo-placeholder {
        width: 90px;
        height: 90px;
    }

    .profile-photo-placeholder span {
        font-size: 40px;
    }
}

/* ========================================
   マイプロフィール：モックアップ対応
======================================== */

.profile-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.profile-card-heading h2 {
    margin: 0;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.profile-summary-photo {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
}

.profile-summary-photo img,
.profile-summary-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-sizing: border-box;
}

.profile-summary-photo img {
    display: block;
    object-fit: cover;
    border: 4px solid #e8f2ec;
}

.profile-summary-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f2ec;
    font-size: 40px;
}

.profile-summary-info {
    flex: 1;
    min-width: 0;
}

.profile-summary-info strong {
    display: block;
    color: #173e35;
    font-size: 17px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.profile-summary-info p {
    margin: 6px 0 10px;
    font-size: 14px;
}

.profile-member-badge {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #21866b;
    border-radius: 5px;
    background: #e9f5ef;
    color: #17654f;
    font-size: 12px;
    font-weight: 600;
}

.profile-photo-edit {
    border-top: 1px solid #e1e8e4;
    padding-top: 14px;
}

.profile-photo-edit summary {
    color: #17654f;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.profile-photo-edit form {
    margin-top: 14px;
}

@media (max-width: 480px) {
    .profile-summary {
        gap: 12px;
    }

    .profile-summary-photo {
        flex-basis: 72px;
        width: 72px;
        height: 72px;
    }

    .profile-summary-info strong {
        font-size: 15px;
    }
}

.profile-view-link {
    color: #17654f;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

.profile-view-link:hover {
    color: #0d3f31;
}

@media (max-width: 480px) {
    .profile-card-heading {
        gap: 10px;
    }

    .profile-view-link {
        font-size: 11px;
    }
}

/* マイプロフィール：利用状況 */

.profile-activity-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #e1e8e4;
    padding: 18px 0;
    margin-top: 12px;
}

.profile-activity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.profile-activity-item span {
    font-size: 12px;
    color: #52667a;
}

.profile-activity-item strong {
    font-size: 26px;
    color: #173e35;
    line-height: 1;
}

/* マイプロフィール：メッセージ件数 */

.profile-activity-item+.profile-activity-item {
    border-left: 1px solid #e1e8e4;
}

.profile-activity-item:nth-child(2) strong {
    color: #e5484d;
}

/* マイプロフィール：3列表示の仕上げ */

.profile-activity-item {
    min-width: 0;
    padding: 0 4px;
}

.profile-activity-item span {
    line-height: 1.5;
}

.profile-activity-item:nth-child(3) strong {
    color: #173e35;
}

/* 掲載案件・求人管理：タイトルバナー */

.listing-management-hero {
    margin: 0 -28px 28px;
    min-height: 200px;
    display: flex;
    align-items: center;
    padding: 30px 36px;
    background:
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.97) 0%,
            rgba(255, 255, 255, 0.91) 43%,
            rgba(255, 255, 255, 0.1) 100%),
        url('/images/dashboard-construction.png') center / cover no-repeat;
}

.listing-management-hero-content {
    max-width: 600px;
}

.listing-management-breadcrumb {
    font-size: 13px;
    color: #50675e;
    margin-bottom: 18px;
}

.listing-management-breadcrumb a {
    color: #00775f;
    text-decoration: underline;
}

.listing-management-breadcrumb span {
    margin: 0 8px;
}

.listing-management-hero h1 {
    margin: 0 0 12px;
    color: #173e35;
    font-size: 32px;
    line-height: 1.3;
}

.listing-management-description {
    margin: 0;
    color: #425d55;
    font-size: 15px;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .listing-management-hero {
        margin: 0 -16px 24px;
        min-height: 180px;
        padding: 24px 20px;
        background-position: center;
    }

    .listing-management-hero h1 {
        font-size: 25px;
    }

    .listing-management-description {
        font-size: 13px;
    }
}

/* 掲載案件・求人管理：切替タブ */

.listing-management-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 24px;
    max-width: 600px;
}

.listing-management-tab {
    padding: 14px 20px;
    border: 1px solid #dce6e1;
    border-radius: 7px;
    background: #edf1f0;
    color: #173e35;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.listing-management-tab.is-active {
    background: #006b56;
    color: #fff;
    border-color: #006b56;
}

@media (max-width: 768px) {
    .listing-management-tabs {
        gap: 8px;
    }

    .listing-management-tab {
        padding: 12px 8px;
        font-size: 14px;
    }
}

/* 掲載案件・求人管理：データ0件の案内 */
.listing-management-empty {
    padding: 24px;
    text-align: center;
    color: #50675e;
    background: #ffffff;
    border: 1px solid #dce6e1;
    border-radius: 8px;
    margin-top: 16px;
}

.listing-management-empty[hidden] {
    display: none;
}

/* 掲載案件・求人管理：集計カード */

.listing-management-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}

.listing-management-stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 18px;
    background: #ffffff;
    border: 1px solid #e0e9e5;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(23, 62, 53, 0.04);
}

.listing-management-stat span {
    color: #53665f;
    font-size: 13px;
    font-weight: 700;
}

.listing-management-stat strong {
    color: #173e35;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
}

/* 公開中の数字を緑色に */
#listing-stat-published {
    color: #008563;
}

/* 募集終了の数字をグレーに */
#listing-stat-closed {
    color: #7a8791;
}

/* タブレット */
@media (max-width: 1100px) {
    .listing-management-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* スマートフォン */
@media (max-width: 600px) {
    .listing-management-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .listing-management-stat {
        padding: 16px 14px;
    }

    .listing-management-stat strong {
        font-size: 25px;
    }
}

/* 掲載案件・求人管理：新規掲載ボタン */

.listing-management-create {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 20px;
}

.listing-management-create a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: #173e35;
    color: #ffffff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease;
}

.listing-management-create a:hover {
    background: #006b57;
    color: #ffffff;
}

@media (max-width: 600px) {
    .listing-management-create a {
        width: 100%;
    }
}

/* 掲載案件・求人管理：ステータスバッジ */

.listing-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.listing-status-published {
    background: #ddf5e8;
    color: #087a50;
}

.listing-status-pending {
    background: #fff2d5;
    color: #926100;
}

.listing-status-draft {
    background: #edf1f5;
    color: #617183;
}

.listing-status-closed {
    background: #e4e7ea;
    color: #59636d;
}

/* ========================================
   応募管理：工事案件・求人の切り替えタブ
======================================== */

.application-type-tabs {
    display: flex;
    gap: 0;
    margin: 24px 0 0;
    border-bottom: 2px solid #dce6e0;
}

.application-type-tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 15px 28px;
    margin-bottom: -2px;
    color: #64736c;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.application-type-tab:hover {
    background: #f0f5f1;
    color: #173e35;
}

.application-type-tab.is-active {
    background: transparent;
    color: #173e35;
    border-bottom-color: #173e35;
}

.application-type-tab:focus-visible {
    outline: 2px solid #173e35;
    outline-offset: -2px;
}

@media (max-width: 600px) {
    .application-type-tab {
        flex: 1;
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* ========================================
   応募管理：応募一覧テーブル
======================================== */

.application-management-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
    font-size: 13px;
}

.application-management-table th,
.application-management-table td {
    border-bottom: 1px solid #e0e8e3;
    padding: 16px 12px;
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.application-management-table th {
    background: #eaf1ed;
    color: #173e35;
    font-weight: 700;
    font-size: 12px;
}

.application-management-table tbody tr:hover {
    background: #f7faf8;
}

/* 応募メッセージの表示 */
.application-management-table td:nth-child(4) {
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* 日時を読みやすくする */
.application-management-table td:nth-child(5) {
    font-size: 12px;
    color: #64736c;
}

/* 操作ボタン */
.application-management-table button {
    padding: 8px 12px;
    font-size: 12px;
    margin: 3px 0;
    white-space: normal;
}

/* スマートフォンでは横スクロール */
@media (max-width: 768px) {
    .application-management-table {
        min-width: 1050px;
    }
}

/* ========================================
   応募管理：一覧と詳細の2カラムレイアウト
======================================== */

.application-management-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.application-list-area {
    min-width: 0;
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e0e8e3;
    border-radius: 10px;
}

.application-detail-panel {
    min-width: 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e0e8e3;
    border-radius: 10px;
}

.application-detail-panel h2 {
    margin-top: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #e0e8e3;
    color: #173e35;
}

.application-detail-panel h3 {
    color: #173e35;
    overflow-wrap: anywhere;
}

.application-detail-panel p {
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* 画面幅が狭い場合は縦並び */
@media (max-width: 1100px) {
    .application-management-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 応募管理：一覧では応募メッセージを非表示 */
.application-management-table th.application-detail-column:nth-child(4),
.application-management-table td.application-detail-column:nth-child(4) {
    display: none;
}

/* 応募管理：添付ファイルは詳細パネルに表示 */
.application-management-table th:nth-child(6),
.application-management-table td:nth-child(6) {
    display: none;
}

/* 応募管理：メールアドレスは詳細パネルで確認 */
.application-management-table th:nth-child(3),
.application-management-table td:nth-child(3) {
    display: none;
}

/* 応募管理：右側の詳細パネルでは操作フォームを表示する */
#detail-application-status-actions form {
    display: block;
    margin-bottom: 8px;
}

/* ========================================
   応募管理：応募状況サマリー
======================================== */

.application-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.application-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    min-height: 110px;
    padding: 16px 10px;
    background: #ffffff;
    border: 1px solid #e0e8e3;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(23, 62, 53, 0.04);
}

.application-summary-card span {
    color: #52645e;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.application-summary-card strong {
    color: #173e35;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

/* タブレット */
@media (max-width: 1200px) {
    .application-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* スマートフォン */
@media (max-width: 600px) {
    .application-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .application-summary-card {
        min-height: 95px;
    }
}

/* 求人タブで不要な集計カードを非表示 */
.application-summary-card[hidden] {
    display: none;
}

/* ========================================
   応募管理：一覧の取消情報をコンパクトに
======================================== */

/* 一覧の取消情報は先頭の状態表示だけを見せる */
.application-management-table
td:nth-child(7) > div > p:not(:first-child) {
    display: none;
}

/* 取消済み応募の再応募情報だけを一覧で非表示 */
.application-management-table
tr[data-application-cancelled="true"]
td:nth-child(7) > div > div {
    display: none;
}

/* ========================================
   応募管理：取消・再応募情報
======================================== */

.application-cancellation-detail {
    width: 100%;
    box-sizing: border-box;
    margin-top: 16px;
}

.application-cancellation-detail > td {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    background: #f7faf8;
    border: 1px solid #dce7e1;
    border-radius: 10px;
}

.application-cancellation-detail p {
    line-height: 1.8;
    margin: 0 0 12px;
}

.application-cancellation-detail p:last-child {
    margin-bottom: 0;
}

/* ========================================
   応募管理：写真付きヘッダー
======================================== */

.application-page-hero {
    display: flex;
    align-items: center;
    min-height: 220px;
    margin: 0 -28px 28px;
    padding: 40px 48px;

    background-image:
        linear-gradient(
            90deg,
            rgba(15, 48, 39, 0.88) 0%,
            rgba(15, 48, 39, 0.65) 50%,
            rgba(15, 48, 39, 0.15) 100%
        ),
        url('/images/dashboard-construction.png');

    background-size: cover;
    background-position: center;
    box-sizing: border-box;
}

.application-page-hero-content {
    max-width: 700px;
    color: #ffffff;
}

.application-page-hero h1 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
}

.application-page-hero p {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.9;
}

/* スマートフォン対応 */
@media (max-width: 768px) {

    .application-page-hero {
        min-height: 180px;
        margin: 0 -16px 24px;
        padding: 28px 24px;
    }

    .application-page-hero h1 {
        font-size: 26px;
    }

    .application-page-hero p {
        font-size: 13px;
    }
}

/* 応募管理：パンくずリスト */
.application-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    font-size: 14px;
    color: #ffffff;
}

.application-breadcrumb a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.application-breadcrumb span {
    color: #ffffff;
}

/* ========================================
   求人詳細画面：ヘッダー・パンくずリスト
======================================== */

.job-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 40px;
    background: #ffffff;
    border-bottom: 1px solid #e1e8e4;
}

.job-detail-logo {
    color: #173e35;
    font-size: 28px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.job-detail-header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.job-detail-header-nav a {
    color: #40554e;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 3px solid transparent;
}

.job-detail-header-nav a:hover,
.job-detail-header-nav a.active {
    color: #176a54;
    border-bottom-color: #176a54;
}

.job-detail-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px 48px;
    box-sizing: border-box;
}

.job-detail-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    color: #536a61;
    font-size: 13px;
}

.job-detail-breadcrumb a {
    color: #536a61;
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .job-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .job-detail-header-nav {
        width: 100%;
        gap: 18px;
        overflow-x: auto;
    }

    .job-detail-header-nav a {
        white-space: nowrap;
        font-size: 13px;
    }

    .job-detail-container {
        padding: 20px 16px 32px;
    }
}

/* ========================================
   求人詳細画面：2カラムレイアウト
======================================== */

.job-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: start;
}

.job-detail-main {
    min-width: 0;
}

.job-detail-card {
    background: #ffffff;
    border: 1px solid #e1e8e4;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(20, 55, 45, 0.04);
}

.job-detail-card h2 {
    margin-top: 0;
    color: #173e35;
    font-size: 25px;
}

.job-detail-sidebar {
    min-width: 0;
}

.job-detail-apply-card {
    background: #ffffff;
    border: 1px solid #e1e8e4;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(20, 55, 45, 0.04);
}

.job-detail-apply-card textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #cbd8d1;
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}

.job-detail-apply-card button[type="submit"] {
    width: 100%;
    padding: 14px 16px;
    background: #e88913;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.job-detail-apply-card button[type="submit"]:hover {
    background: #cf760c;
}

@media (max-width: 768px) {
    .job-detail-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .job-detail-card {
        padding: 20px;
    }

    .job-detail-apply-card {
        padding: 20px;
    }
}

/* ========================================
   求人詳細画面：基本情報・募集詳細
======================================== */

.job-detail-info-section {
    margin-top: 28px;
}

.job-detail-section-title {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #f0f6f3;
    border-left: 4px solid #176a54;
    border-radius: 4px;
    color: #173e35;
    font-size: 17px;
    font-weight: 700;
}

.job-detail-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.job-detail-info-table th,
.job-detail-info-table td {
    padding: 14px 16px;
    border: 1px solid #e1e8e4;
    text-align: left;
    vertical-align: top;
    line-height: 1.7;
}

.job-detail-info-table th {
    width: 30%;
    background: #f5f8f6;
    color: #40554e;
    font-weight: 700;
}

.job-detail-info-table td {
    background: #ffffff;
    color: #263e35;
}

.job-detail-info-section h4 {
    margin: 22px 0 8px;
    color: #176a54;
    font-size: 15px;
}

.job-detail-info-section p {
    margin: 0;
    color: #40554e;
    line-height: 1.8;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .job-detail-info-table th,
    .job-detail-info-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .job-detail-info-table th {
        width: 34%;
    }

    .job-detail-section-title {
        font-size: 16px;
    }
}

/* 求人詳細：応募エリア */

.job-detail-apply-title {
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e1e8e4;
    color: #173e35;
    font-size: 19px;
    font-weight: 700;
}

.job-detail-apply-notice {
    padding: 18px;
    background: #f0f6f3;
    border: 1px solid #dce8e1;
    border-radius: 8px;
}

.job-detail-apply-notice strong {
    display: block;
    margin-bottom: 8px;
    color: #173e35;
    font-size: 15px;
}

.job-detail-apply-notice p {
    margin: 0;
    color: #536a61;
    font-size: 13px;
    line-height: 1.7;
}

/* 求人詳細：応募エリアの二重枠を解消 */
.job-detail-apply-card > .job-detail-apply-notice {
    margin-top: 0;
}

.job-detail-apply-card {
    border: none;
    box-shadow: none;
    padding: 0;
}

/* 工事案件詳細画面：中央配置 */
.job-detail-container {
    width: min(1200px, calc(100% - 40px));
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 64px;
    box-sizing: border-box;
}

/* 工事案件詳細：応募ボタン */
.construction-detail-apply-button {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: #ed8b0c;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.construction-detail-apply-button:hover {
    background: #d77900;
}

/* 工事案件詳細：お気に入りボタン */
.construction-detail-favorite-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #ffffff;
    color: #173e35;
    border: 1px solid #173e35;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.construction-detail-favorite-button:hover {
    background: #eef5f2;
}

.job-detail-apply-card button.construction-detail-favorite-button {
    background: #ffffff;
    color: #173e35;
    border: 1px solid #173e35;
}

.job-detail-apply-card .construction-detail-favorite-button:hover {
    background: #eef5f2;
}

/* 工事案件詳細：タイトルとお気に入り */
.construction-detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.construction-detail-title-row h2 {
    margin: 0;
}

.construction-detail-title-favorite {
    flex-shrink: 0;
}

.construction-detail-title-favorite form {
    margin: 0;
}

.construction-detail-title-favorite .construction-detail-favorite-button {
    width: auto;
    padding: 10px 16px;
}

@media (max-width: 600px) {
    .construction-detail-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 工事案件詳細：応募エリアの余白調整 */
.job-detail-sidebar .job-detail-apply-card {
    padding: 24px;
    border-radius: 12px;
}

.job-detail-sidebar .job-detail-apply-card h3 {
    margin: 0 0 20px;
    font-size: 18px;
}

.job-detail-sidebar .job-detail-apply-card textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 140px;
    resize: vertical;
}

.job-detail-sidebar .job-detail-apply-card form {
    margin-bottom: 16px;
}

.job-detail-sidebar .job-detail-apply-card form button[type="submit"] {
    border-radius: 8px;
}

/* 工事案件・求人詳細：ヘッダーナビゲーション */
.job-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 36px;
    box-sizing: border-box;
}

.job-detail-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.job-detail-nav a {
    display: inline-block;
    white-space: nowrap;
    text-decoration: none;
    color: #173e35;
    font-weight: 600;
}

.job-detail-nav a:hover {
    color: #e88913;
}

@media (max-width: 600px) {
    .job-detail-header {
        padding: 16px;
        flex-wrap: wrap;
    }

    .job-detail-nav {
        gap: 16px;
        flex-wrap: wrap;
    }
}

/* 工事案件詳細：掲載企業カード */
.construction-detail-company-card {
    margin-top: 16px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e2e8e5;
    border-radius: 12px;
}

.construction-detail-company-card h3 {
    margin: 0 0 20px;
    color: #173e35;
    font-size: 18px;
}

.construction-detail-company-name {
    font-size: 18px;
    font-weight: 700;
    color: #173e35;
    margin-bottom: 16px;
}

.construction-detail-company-card p {
    margin: 12px 0;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* 工事案件詳細：掲載企業名リンク */
a.construction-detail-company-name {
    display: inline-block;
    text-decoration: none;
}

a.construction-detail-company-name:hover {
    color: #e88913;
    text-decoration: underline;
}

/* 工事案件詳細：施工写真ギャラリー */
.construction-photo-gallery {
    margin: 24px 0 32px;
}

.construction-photo-gallery h3 {
    color: #173e35;
    font-size: 18px;
    margin-bottom: 16px;
}

.construction-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.construction-photo-grid a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4 / 3;
    background: #edf2f0;
}

.construction-photo-grid a.construction-photo-main {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

.construction-photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.construction-photo-grid a:hover img {
    transform: scale(1.03);
}

@media (max-width: 600px) {
    .construction-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .construction-photo-grid a.construction-photo-main {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 16 / 9;
    }
}

/* 工事案件詳細：添付ファイル登録 */
.construction-attachment-upload {
    margin: 28px 0;
    padding: 20px;
    background: #f4f8f6;
    border: 1px solid #dce7e1;
    border-radius: 10px;
}

.construction-attachment-upload h3 {
    margin: 0 0 16px;
    color: #173e35;
    font-size: 17px;
}

.construction-attachment-upload form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.construction-attachment-upload input[type="file"] {
    max-width: 100%;
}

.construction-attachment-upload button {
    padding: 11px 18px;
    border: none;
    border-radius: 8px;
    background: #173e35;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.construction-attachment-upload p {
    margin: 12px 0 0;
    font-size: 12px;
    color: #64746d;
}

/* 工事案件詳細：基本情報と募集詳細を横並び */
.construction-detail-info-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.construction-detail-info-layout > .job-detail-info-section {
    min-width: 0;
    margin-top: 0;
}

@media (max-width: 768px) {
    .construction-detail-info-layout {
        grid-template-columns: 1fr;
    }
}

/* 工事案件詳細：基本情報と募集詳細の幅を調整 */
.construction-detail-info-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.construction-detail-info-layout > * {
    min-width: 0;
}

@media (max-width: 768px) {
    .construction-detail-info-layout {
        grid-template-columns: 1fr;
    }
}

/* 工事案件詳細：施工写真をコンテンツ幅に合わせる */
.construction-photo-grid {
    width: 100%;
}

.construction-photo-grid > a:only-child {
    grid-column: 1 / -1;
}

.construction-photo-grid > a:only-child img {
    width: 100%;
    max-width: 100%;
    height: 400px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .construction-photo-grid > a:only-child img {
        height: 240px;
    }
}

/* 工事案件詳細：基本情報・募集詳細のカードデザイン */
.construction-detail-info-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
    margin-top: 24px;
}

.construction-detail-info-layout > .job-detail-info-section {
    min-width: 0;
    margin: 0;
    padding: 18px;
    background: #f8faf9;
    border: 1px solid #e0e9e5;
    border-radius: 10px;
}

.construction-detail-info-layout > .job-detail-info-section h3 {
    margin: 0 0 16px;
    padding-left: 10px;
    border-left: 4px solid #17634f;
    color: #173e35;
}

.construction-detail-info-layout .job-detail-info-table {
    width: 100%;
}

@media (max-width: 768px) {
    .construction-detail-info-layout {
        grid-template-columns: 1fr;
    }
}

/* 工事案件詳細：基本情報と募集詳細の高さを統一 */
.construction-detail-info-layout {
    align-items: stretch;
}

.construction-detail-info-layout > .job-detail-info-section {
    height: 100%;
    box-sizing: border-box;
}

/* ========================================
   工事案件詳細：添付資料カード
======================================== */

.construction-documents-card {
    margin-top: 24px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e0e9e5;
    border-radius: 10px;
}

.construction-documents-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #17634f;
    color: #173e35;
    font-size: 18px;
}

.construction-documents-list {
    display: flex;
    flex-direction: column;
}

.construction-document-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e9e7;
}

.construction-document-item:last-child {
    border-bottom: none;
}

.construction-document-icon {
    flex-shrink: 0;
    padding: 7px 5px;
    border-radius: 4px;
    background: #d94b4b;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
}

.construction-document-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.construction-document-download,
.construction-document-delete {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #b9cdc5;
    border-radius: 6px;
    background: #ffffff;
    color: #173e35;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
}

.construction-document-delete {
    color: #b42318;
}

.construction-documents-empty {
    margin: 0;
    color: #64746e;
}

@media (max-width: 768px) {
    .construction-document-item {
        flex-wrap: wrap;
    }

    .construction-document-name {
        flex-basis: calc(100% - 50px);
    }
}

/* 工事案件詳細：施工写真と削除ボタン */
.construction-photo-grid > .construction-photo-item {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
}

.construction-photo-grid > .construction-photo-item.construction-photo-main {
    grid-column: span 2;
    grid-row: span 2;
}

.construction-photo-item > a {
    display: block;
    width: 100%;
    height: 100%;
}

.construction-photo-item > a > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.construction-photo-delete-form {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
}

.construction-photo-delete-button {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: rgba(150, 30, 30, 0.92);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.construction-photo-delete-button:hover {
    background: #a61b1b;
}

/* 写真が1枚の場合は横幅いっぱいに表示 */
.construction-photo-grid > .construction-photo-item:only-child {
    grid-column: 1 / -1;
    grid-row: auto;
}

.construction-photo-grid > .construction-photo-item:only-child > a > img {
    height: 400px;
}

@media (max-width: 768px) {
    .construction-photo-grid > .construction-photo-item:only-child > a > img {
        height: 240px;
    }
}

/* 工事案件詳細：写真の余白を解消 */
.construction-photo-grid > .construction-photo-item:only-child {
    height: 400px;
}

.construction-photo-grid > .construction-photo-item:only-child > a {
    height: 100%;
}

.construction-photo-grid > .construction-photo-item:only-child > a > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 削除ボタンを写真の右上に配置 */
.construction-photo-delete-form {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: auto;
    margin: 0;
    z-index: 5;
}

@media (max-width: 768px) {
    .construction-photo-grid > .construction-photo-item:only-child {
        height: 240px;
    }
}