/* 協力業者ページ・管理画面の共通スタイル（スマートフォンでの利用を優先） */

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

:root {
    --accent: #c8522a;
    --accent-dark: #a8431f;
    --text: #333333;
    --muted: #6b6b6b;
    --bg: #f8f6f2;
    --card: #ffffff;
    --line: #e3ded6;
    --soft: #fff8f5;
    --ok: #2f7d4f;
    --ok-bg: #eaf5ee;
    --warn: #9a6a00;
    --warn-bg: #fff5d9;
    --ng: #b3261e;
    --ng-bg: #fdecea;
}

body {
    margin: 0;
    font-family: sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
}

.app-header {
    background: var(--text);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.app-header a { color: #fff; text-decoration: none; }
.app-header .brand { font-weight: bold; font-size: 15px; line-height: 1.4; }
.app-header .brand small { display: block; font-weight: normal; font-size: 12px; opacity: 0.8; }
.app-header .header-links { display: flex; gap: 14px; font-size: 14px; white-space: nowrap; }

.app-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

.app-main.wide { max-width: 1100px; }

h1 { font-size: 1.4rem; line-height: 1.5; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; line-height: 1.5; margin: 28px 0 12px; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; line-height: 1.5; }

.lead { color: var(--muted); margin-top: 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
}

.card.plain { border-left-width: 1px; }
.card.done { border-left-color: var(--line); opacity: 0.85; }

.meta { color: var(--muted); font-size: 14px; margin: 2px 0; }
.meta strong { color: var(--text); font-weight: normal; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--line);
    color: var(--text);
    margin-right: 6px;
    vertical-align: middle;
    white-space: nowrap;
}
.badge.open { background: var(--soft); color: var(--accent-dark); border: 1px solid var(--accent); }
.badge.bidding { background: var(--warn-bg); color: var(--warn); }
.badge.awarded, .badge.approved, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.declined, .badge.rejected, .badge.cancelled, .badge.suspended, .badge.ng { background: var(--ng-bg); color: var(--ng); }
.badge.pending { background: var(--warn-bg); color: var(--warn); }

/* フォーム */
form { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 14px 16px 6px; margin: 0 0 16px; }
legend { font-weight: bold; padding: 0 6px; }

.field { margin-bottom: 14px; }
.field > label, .field > .label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 15px; }
.req { color: var(--ng); font-size: 12px; margin-left: 6px; font-weight: normal; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="date"], select, textarea {
    width: 100%;
    font: inherit;
    padding: 10px 12px;
    border: 1px solid #c9c3b9;
    border-radius: 6px;
    background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.choices label, .check { display: flex; align-items: flex-start; gap: 8px; font-weight: normal; line-height: 1.5; font-size: 15px; cursor: pointer; }
.choices input, .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.choice-group-title { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: 6px; }

.btn {
    display: inline-block;
    font: inherit;
    font-weight: bold;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 22px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.block { display: block; width: 100%; }
.btn.sub { background: #fff; color: var(--accent-dark); border: 1px solid var(--accent); }
.btn.sub:hover { background: var(--soft); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.danger { background: #fff; color: var(--ng); border: 1px solid var(--ng); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.msg { border-radius: 6px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.ng { background: var(--ng-bg); color: var(--ng); }
.msg.info { background: var(--soft); color: var(--text); border-left: 4px solid var(--accent); }
.hidden { display: none !important; }

details.box { background: var(--soft); border-radius: 6px; padding: 10px 14px; margin-top: 12px; }
details.box summary { cursor: pointer; font-weight: bold; color: var(--accent-dark); }

.private { background: var(--ok-bg); border-radius: 6px; padding: 12px 14px; margin-top: 12px; }

/* 管理画面 */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--accent); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
    font: inherit; background: none; border: none; padding: 10px 16px; cursor: pointer; color: var(--muted);
    border-radius: 6px 6px 0 0; white-space: nowrap;
}
.tabs button.active { background: var(--accent); color: #fff; font-weight: bold; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
table.list { border-collapse: collapse; width: 100%; font-size: 14px; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { background: var(--soft); white-space: nowrap; }
table.list tr.flag td { background: var(--warn-bg); }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: var(--soft); }
.num { text-align: right; white-space: nowrap; }
.dev-hi { color: var(--ng); font-weight: bold; }
.dev-lo { color: #1f5fa8; font-weight: bold; }

.footer-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 40px; }

@media (min-width: 700px) {
    .app-header { padding: 16px 28px; }
    .app-main { padding: 28px 24px 80px; }
}

/* 案件の職種ごとの募集状況 */
.lots-title { font-size: 14px; font-weight: bold; margin: 12px 0 6px; }
ul.lots { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.lots li.lot { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.lots li.lot.mine { background: var(--soft); margin: 0 -16px; padding: 10px 16px; }
.lot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.lot-name { font-weight: bold; margin-right: auto; }
.tag { font-size: 11px; color: var(--accent-dark); border: 1px solid var(--accent); border-radius: 4px; padding: 0 6px; background: #fff; }
.badge.closed { background: #eeeeee; color: var(--muted); }
.bid-box { background: var(--warn-bg); border-radius: 6px; padding: 12px 14px; margin-top: 10px; }
.lot details.box { margin-top: 8px; }
.lot-admin { border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 12px 14px; margin-bottom: 14px; }
.lot-admin h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lot.mine details.box { background: #fff; }
.lot-est { display: grid; grid-template-columns: 12em 1fr; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: normal; }
.site-box { background: #eef4fb; border-radius: 6px; padding: 12px 14px; margin-top: 12px; }
.site-box a { color: var(--accent-dark); word-break: break-all; }
.lot-form .check { font-size: 14px; }
.app-main .site-box dl.facts dd { white-space: pre-wrap; }
