:root{--bg:#f4f6fa;--panel:#fff;--text:#172033;--muted:#697586;--line:#e1e6ef;--navy:#172b4d;--blue:#315b91;--green:#23834b;--red:#bd4545;--amber:#a96812}
body{margin:0;background:var(--bg);color:var(--text);font-family:Arial,"Noto Sans JP",sans-serif;font-size:14px;line-height:1.55}.app{display:flex;min-height:100vh}.main{flex:1;min-width:0}.topbar{min-height:70px;display:flex;align-items:center;justify-content:space-between;padding:14px 26px;background:#fff;border-bottom:1px solid var(--line)}.crumb,.muted,.small{color:var(--muted)}.crumb,.small{font-size:12px}.top-title{font-size:18px;font-weight:700}.content{max-width:1600px;margin:auto;padding:24px 26px}.heading{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:18px}h1{font-size:26px;margin:0 0 5px}.sub{color:var(--muted)}.btn,select,input{font:inherit}.btn{border:1px solid #cbd5e1;background:#fff;color:var(--text);border-radius:8px;padding:9px 13px;font-weight:700;cursor:pointer}.btn.primary{background:var(--blue);border-color:var(--blue);color:white}.btn.active{background:#eaf1fa;border-color:#8ca9cb;color:#244c7b}.panel,.metric{background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 2px 7px rgba(20,35,60,.025)}.panel{padding:17px;margin-bottom:17px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px}h2{font-size:17px;margin:0}.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.toolbar select,.toolbar input{border:1px solid #cbd5e1;border-radius:8px;background:white;padding:8px 10px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:17px}.metric{padding:13px 16px}.metric-label{font-size:12px;color:var(--muted)}.metric-value{font-weight:800;margin-top:2px}.metric-note{font-size:11px;color:var(--muted)}.calendar-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.month-label{font-size:21px;font-weight:800;min-width:150px;text-align:center}.month-nav{display:flex;align-items:center;gap:7px}.calendar-wrap{overflow-x:auto}.calendar{display:grid;grid-template-columns:repeat(7,minmax(125px,1fr));min-width:900px;border-top:1px solid var(--line);border-left:1px solid var(--line)}.weekday{padding:8px;text-align:center;font-weight:700;font-size:12px;background:#f8fafc;border-right:1px solid var(--line);border-bottom:1px solid var(--line);color:#536174}.weekday.sun{color:#c04444}.weekday.sat{color:#3568a5}.day{min-height:126px;background:white;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:6px;cursor:pointer;position:relative}.day:hover{background:#f8fbff}.day.outside{background:#f7f8fa;color:#a0a8b5}.day.selected{outline:2px solid #4779b8;outline-offset:-2px;background:#f1f6fd}.day.today .day-number{background:var(--navy);color:#fff;border-radius:50%;width:25px;height:25px;display:inline-flex;align-items:center;justify-content:center}.day-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}.day-number{font-weight:700;font-size:13px;padding:3px 5px}.day-count{font-size:10px;color:var(--muted)}.task-bar{display:block;width:100%;text-align:left;border:0;border-radius:4px;padding:4px 5px;margin:3px 0;color:#24415f;background:#e7eff9;font-size:10px;line-height:1.35;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;border-left:3px solid #5482b5}.task-bar.body{background:#e8f3e9;border-left-color:#398451;color:#245b35}.task-bar.service{background:#fff2df;border-left-color:#c18a35;color:#765018}.task-bar.done{opacity:.75;text-decoration:line-through;border-left-color:#bd4545!important}
.task-bar.status-start{border-left-color:#398451!important}
.task-bar.status-done{border-left-color:#bd4545!important}
.task-bar.status-today{border-left-color:#d5a21d!important}
.task-bar.status-pending{border-left-color:#5482b5!important}
.legend span[style*="--legend-color"]{display:inline-flex;align-items:center}
.legend span[style*="--legend-color"]:before{content:"";display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px;background:#f3f4f6;border-left:3px solid var(--legend-color)}.task-bar .bar-staff{opacity:.8}.more{font-size:10px;color:var(--muted);padding-left:4px}.legend{display:flex;gap:13px;flex-wrap:wrap;margin-top:11px;font-size:11px;color:var(--muted)}.legend span:before{content:"";display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px;background:#e8f3e9;border-left:3px solid #398451}.legend .service-key:before{background:#fff2df;border-left-color:#c18a35}.legend .pending-key:before{background:#e7eff9;border-left-color:#5482b5}.detail-grid{display:block}.detail-grid>div+div{margin-top:18px}.task-detail-list{display:grid;grid-template-columns:1fr;gap:12px}.detail-card{padding:15px}.detail-card h3{font-size:15px}.memo-input-row{display:flex;align-items:flex-start;gap:8px}.memo-input-row textarea{flex:1;min-width:0}.memo-add-btn{width:38px;height:38px;flex:0 0 38px;border:1px solid #9db4d1;border-radius:8px;background:#eef5fc;color:#244c7b;font-size:23px;line-height:1;cursor:pointer}.memo-file-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}.memo-file{background:#eef2f7;border-radius:5px;padding:4px 7px;font-size:11px;color:#475569}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:760px}th,td{padding:10px 9px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{background:#f8fafc;color:#536174;font-size:11px;white-space:nowrap}td{font-size:13px}.vehicle{font-weight:700}.secondary{display:block;font-size:11px;color:var(--muted);margin-top:2px}.pill{display:inline-block;border-radius:5px;padding:3px 7px;font-size:11px;font-weight:700;background:#eef2f7;color:#475569;white-space:nowrap}.pill.start{background:#e1f3e6;color:#21683a}.pill.done{background:#fbe5e5;color:#a33b35}.pill.today{background:#262b33;color:#fff}.pill.service{background:#fff2df;color:#765018}.status-select{padding:6px;border:1px solid #cbd5e1;border-radius:6px;background:white}.detail-card{border:1px solid var(--line);border-radius:9px;padding:12px;margin-bottom:9px}.detail-card:last-child{margin-bottom:0}.detail-card h3{font-size:14px;margin:0 0 5px}.detail-card p{margin:3px 0;color:#536174;font-size:12px}.empty{padding:25px;text-align:center;color:var(--muted)}.notice{background:#eff6ff;color:#1d4f91;padding:10px 13px;border-radius:8px;font-size:12px;margin-bottom:15px}.return{color:var(--amber);font-weight:700}.view-switch{display:flex;gap:6px}.day-nav{display:flex;gap:7px;align-items:center}.day-nav input{border:1px solid #cbd5e1;border-radius:8px;padding:7px}.mobile-hint{display:none}
@media(max-width:1050px){.detail-grid{grid-template-columns:1fr}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.app{display:block}.topbar{padding:12px 15px}.content{padding:17px 12px}.heading{display:block}h1{font-size:22px}.heading .btn{margin-top:10px}.metrics{gap:8px}.metric{padding:10px}.metric-value{}.panel{padding:12px}.mobile-hint{display:block}.calendar{min-width:840px}.day{min-height:112px}}
@media print{.sidebar,.topbar,.heading .btn,.toolbar,.month-nav,.notice{display:none!important}.app{display:block}.content{padding:0;max-width:none}body{background:#fff}.panel,.metric{box-shadow:none;break-inside:avoid}.calendar{min-width:0}.day{min-height:100px}}

/* 改修：新着案件・従業員入力・添付ファイル */
.inbox-panel{border-color:#c8d9ee;background:#f5f9ff}
.inbox-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.inbox-item{background:#fff;border:1px solid #dce6f2;border-radius:9px;padding:12px;display:flex;justify-content:space-between;gap:10px;align-items:center}
.inbox-item strong{display:block}
.inbox-meta{font-size:11px;color:var(--muted)}
.new-badge{display:inline-block;background:#fff0f0;color:#b33b3b;border-radius:20px;padding:2px 7px;font-size:10px;font-weight:700}
.new-count{display:inline-block;background:#bd4545;color:white;border-radius:20px;padding:3px 9px;font-weight:700;font-size:12px}
.employee-form{display:grid;gap:10px;margin-top:12px}
.employee-form label{display:grid;gap:4px;font-size:12px;color:#536174;font-weight:700}
.employee-form input,.employee-form textarea,.employee-form select{width:100%;font:inherit;border:1px solid #cbd5e1;border-radius:7px;padding:8px;background:#fff;color:var(--text)}
.employee-form textarea{min-height:65px;resize:vertical}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.attachment-group{border:1px solid var(--line);border-radius:8px;padding:10px;display:grid;gap:6px}
.attachment-group input[type=file]{font-size:11px;padding:5px}
.file-list{font-size:11px;color:#536174;display:grid;gap:3px}
.file-preview{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.file-preview img{width:58px;height:58px;object-fit:cover;border-radius:5px;border:1px solid var(--line)}
.step-list{display:flex;gap:5px;flex-wrap:wrap;margin:7px 0}
.step-chip{border:1px solid #d5deea;border-radius:20px;padding:4px 8px;font-size:11px;background:#f8fafc}
.step-chip.current{background:#e3f1e7;border-color:#9cc9a8;color:#21683a;font-weight:700}
.log-list{margin-top:10px;padding-top:9px;border-top:1px solid var(--line)}
.log-entry{font-size:11px;color:#536174;padding:4px 0}
.insurance-pill{display:inline-block;border-radius:5px;padding:3px 7px;font-size:11px;font-weight:700;background:#fff2df;color:#8a5810}
.insurance-pill.none{background:#eef2f7;color:#536174}
@media(max-width:760px){.inbox-list{grid-template-columns:1fr}.inbox-item{align-items:flex-start;flex-direction:column}.form-grid{grid-template-columns:1fr}}

/* Requests-style count typography. */
.metric-value{font-size:var(--dashboard-count-size);font-family:var(--dashboard-count-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", Meiryo, sans-serif);line-height:1.3}
.metric-value .metric-unit{font-size:var(--dashboard-count-unit-size);font-weight:400}
@media(max-width:760px){.metric-value{font-size:var(--dashboard-count-size-mobile)}}

/* KPI typography only; page header/layout remains page-specific */
.metrics .metric-label{font-size:14px;line-height:1.5;}

.metrics .metric-note{font-size:13px;line-height:1.6;margin-top:6px;}

/* 期間バー・案件切替・日報一覧 */
.week-strip{grid-column:1/-1;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));position:relative}.week-day.day{min-height:0;text-align:left;align-content:start;display:flex;align-items:flex-start;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0;font:inherit}.period-bar.task-bar{z-index:1;width:auto;min-width:0;margin:2px 3px;padding:4px 7px;font-size:12px;border:0;white-space:normal;overflow-wrap:anywhere;line-height:1.15}.period-bar.edge-start{border-left:4px solid #398451}.period-bar.edge-end{border-right:4px solid #bd4545}.period-bar.edge-single{border-left:4px solid #d5a21d;border-right:0}.task-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:10px}.job-select{border:0;background:none;color:var(--blue);font:inherit;font-weight:700;cursor:pointer;text-align:left;padding:0}.selected-row{background:#eef5ff}.update-badge{display:inline-block;background:#fff0d4;color:#805000;font-size:11px;padding:3px 6px;border-radius:5px;margin:4px;white-space:nowrap}.estimate-box,.report-group{border:1px solid var(--line);border-radius:8px;padding:12px;margin:10px 0;overflow-wrap:anywhere}.estimate-box .btn{margin-left:8px}.report-group .log-entry{border-top:1px solid var(--line);margin-top:8px;padding:8px 0;font-size:13px;white-space:pre-wrap}#estimateDialog{width:min(600px,90vw);max-height:85vh;overflow:auto;border:1px solid var(--line);border-radius:12px;padding:18px;box-sizing:border-box}#estimateDialog::backdrop{background:#17203388}.new-count{white-space:nowrap;flex-shrink:0}.employee-form input,.employee-form textarea,.employee-form select{box-sizing:border-box;min-width:0}.form-actions{display:flex;flex-wrap:wrap;gap:8px}.legend strong{color:var(--text)}.calendar-wrap{max-width:100%}@media(max-width:760px){.calendar{min-width:980px}.panel{min-width:0}.task-tabs .btn{font-size:12px}.day-nav{flex-shrink:0}}

/* 預かり期間と作業予定の重ね表示 */
.period-bar.custody-bar{background:#e5e7eb;color:#334155;border:1px solid #c5cbd4;padding:2px 0;display:flex;flex-direction:column;gap:1px;text-align:left;overflow:hidden;box-sizing:border-box}.custody-name{padding:0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700}.custody-dates{display:flex;justify-content:space-between;padding:0 5px;font-size:10px;min-height:12px}.plan-track{display:block;position:relative;height:19px;width:100%;flex-shrink:0}.plan-inner{position:absolute;top:0;height:19px;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:2px 4px;font-size:11px;background:#e8f3e9;color:#245b35}.plan-inner.service{background:#fff2df;color:#765018}.plan-inner.begin{border-left:4px solid #398451}.plan-inner.finish{border-right:4px solid #bd4545}.plan-inner.single{border-left:4px solid #d5a21d;background:#fff1c7}.plan-unset{padding:0 5px;color:#536174;font-size:11px}.legend .custody-key:before{background:#e5e7eb;border-left-color:#9ca3af}.work-fields{border:0;padding:0;margin:0;min-width:0;display:grid;gap:10px}.custody-info{background:#f1f3f6;border:1px solid #dce1e8;border-radius:8px;padding:10px}.work-fields:disabled{opacity:.8}

/* カレンダーの預かり期間をコンパクトに表示 */
.period-bar.custody-bar{margin:1px 3px;padding:1px 0;gap:0;line-height:1.1}.custody-name{line-height:13px;font-size:11px;min-height:13px}.custody-dates{display:block;line-height:11px;min-height:11px;font-size:10px;white-space:nowrap}.plan-track{height:15px}.plan-inner{height:15px;line-height:13px;padding:0 4px;font-size:10px}.plan-unset{display:block;line-height:15px;font-size:10px}

/* 預かり期間を担当者名と同じ行に表示 */
.custody-heading{display:flex;align-items:center;gap:5px;min-width:0;width:100%;padding:0 5px;box-sizing:border-box;height:15px;flex-shrink:0;white-space:nowrap}.custody-heading .custody-name{padding:0;min-width:0;flex:0 1 auto;line-height:15px}.custody-heading .custody-dates{padding:0;flex:0 0 auto;line-height:15px;font-size:10px}.period-bar.custody-bar{justify-content:flex-start}

/* 車種・苗字・担当者を省略しない。狭い場合は日付を非表示。 */
.period-bar.custody-bar{container-type:inline-size;overflow:visible}
.custody-heading{height:auto;min-height:15px;white-space:normal;align-items:flex-start}
.custody-heading .custody-name{flex:0 1 auto;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:15px}
@container (max-width: 270px){.custody-heading .custody-dates{display:none}}

/* 片側のみ設定された作業予定 */
.plan-unknown{position:absolute;top:0;height:15px;line-height:13px;box-sizing:border-box;border-top:1px dashed #64748b;color:#475569;font-size:10px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plan-warning{display:inline-block;margin-top:3px;padding:2px 6px;border-radius:5px;background:#fff0d4;color:#805000;font-size:11px;font-weight:700;white-space:nowrap}.plan-help{margin:0;color:#64748b;font-size:12px}.partial-marker{font-weight:700}
