:root {
    color-scheme: light;
    font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
    color: #202a38;
    background: #f8fafc;
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.login-page { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(100%, 640px); padding: 44px 40px; background: white; border: 1px solid #bcc4cf; border-radius: 16px; box-shadow: 0 12px 38px #1822300d; }
h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); font-weight: 700; line-height: 1.5; }
.login-card h1 { text-align: center; }
.login-secondary { margin: 22px 0 0; text-align: center; font-size: 14px; line-height: 1.7; }
.login-secondary a { color: #325c86; text-underline-offset: 3px; }
.sso-card .actions { justify-content: center; }
.sso-card .actions .button { flex: 0 1 280px; }
.intro { text-align: center; color: #546071; margin: 20px 0 28px; line-height: 1.8; }
.login-form { background: white; padding: 28px 32px; border: 1px solid #d6e2f0; border-radius: 10px; }
.login-form input:not([type="hidden"]) { font-size: 20px; min-height: 56px; }
.login-form label { font-size: 17px; }
.field + .field { margin-top: 24px; }
label { display: block; font-weight: 600; margin-bottom: 10px; }
input:not([type="hidden"]) { display: block; width: 100%; min-width: 0; min-height: 52px; border: 1px solid #929eae; border-radius: 6px; padding: 10px 14px; background: #fff; color: #202a38; font: inherit; }
:focus-visible { outline: 3px solid #96b8fc; outline-offset: 3px; }
.actions { display: flex; gap: 20px; margin-top: 32px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 50px; padding: 12px 24px; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; line-height: 1.5; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.actions .button { flex: 1; }
.primary { background: #1769df; color: #fff; box-shadow: 0 2px 4px #1769df20; }
.primary:hover { background: #1d50bd; }
.primary:disabled { background: #7187a9; cursor: not-allowed; }
.secondary { border-color: #b8c8db; background: white; color: #305477; }
.secondary:hover { background: #edf5ff; border-color: #6d9cd5; }
.danger { border-color: #c38989; background: white; color: #a32e35; }
.danger:hover { background: #fff0f0; }
.danger-solid { background: #b3323b; color: white; }
.danger-solid:hover { background: #92262e; }
.danger-solid:disabled { background: #a4aab3; cursor: not-allowed; }
.master-page.delete-page { max-width: 900px; }
.delete-page dd { overflow-wrap: anywhere; }
.delete-confirm { display: flex; align-items: flex-start; gap: 12px; margin: 0; line-height: 1.7; }
.delete-confirm input[type=checkbox] { flex: 0 0 20px; width: 20px; min-height: 20px; height: 20px; margin: 3px 0 0; padding: 0; accent-color: #b3323b; }
.row-actions { display: flex; justify-content: center; align-items: center; gap: 10px; }
.row-actions .button { width: 56px; min-height: 34px; padding: 5px 8px; white-space: nowrap; border-radius: 6px; }
.row-actions .secondary { background: #edf5ff; color: #165eaf; border-color: #bed7f3; }
.row-actions .secondary:hover { background: #dcecff; border-color: #6d9cd5; }
.row-actions .danger { background: #fff5f5; border-color: #edc9cd; }
.row-actions .danger:hover { background: #ffe6e9; border-color: #cc8d96; }
.notice, .error { padding: 14px 18px; border: 1px solid #b6cbe5; border-radius: 8px; background: #eff5fd; line-height: 1.8; margin: 0 0 24px; overflow-wrap: anywhere; }
.error { border-color: #d89595; color: #8b2424; background: #fff3f3; }
.app-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: white; color: #244060; padding: 16px 30px; flex-wrap: wrap; border-top: 3px solid #1769df; border-bottom: 1px solid #c8d8ea; box-shadow: 0 2px 8px #24406006; }
.app-title { font-size: 22px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 20px; margin: 0; }
.content-card { max-width: 960px; margin: 48px auto; padding: 36px; border: 1px solid #ced9e5; border-radius: 12px; background: white; }
dl { display: grid; grid-template-columns: 130px 1fr; gap: 16px; margin: 28px 0; }
dt { color: #526580; } dd { margin: 0; }
.content-card .notice { margin-bottom: 0; }
@media (max-width: 640px) {
    .login-page { padding: 24px 16px; }
    .login-card { padding: 32px 20px; border-radius: 14px; }
    .login-form { padding: 24px 18px; }
    .intro { margin: 20px 0 24px; }
    .actions { gap: 12px; }
    .button { padding: 12px 16px; }
    .content-card { margin: 24px 16px; padding: 24px; }
}

/* Master screens: explicit cell borders and consistent field widths. */
.brand-link { color: inherit; text-decoration: none; }
.nav-current { color: #155cbd; background: #eaf3ff; border-radius: 8px; padding: 12px 16px; text-decoration: none; display: inline-block; font-weight: 700; box-shadow: inset 0 -3px #1769df; }
.master-page { max-width: 1680px; margin: 0 auto; padding: 28px 32px 48px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { font-size: 27px; }
.page-heading p, .muted, .help { color: #546071; line-height: 1.7; }
.page-heading p { margin: 6px 0 0; }
.filter-panel, .edit-panel { border: 1px solid #c4d3e3; border-radius: 10px; background: white; box-shadow: 0 2px 6px #24406004; }
.filter-panel h2 { color: #2467a8; }
.filter-panel { padding: 20px 22px 24px; }
h2 { font-size: 17px; margin: 0 0 18px; }
.filter-row, .form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 24px; }
.control { width: 180px; min-width: 0; }
.control label { font-size: 14px; }
.control.keyword { flex: 1 1 250px; max-width: 420px; }
.control input:not([type="hidden"]), .control select { min-height: 44px; font-size: 15px; }
select { appearance: none; width: 100%; border: 1px solid #a5b7ca; border-radius: 6px; padding: 9px 42px 9px 12px; background: white url('/assets/chevron-down.svg') no-repeat right 14px center / 14px 14px; color: #202a38; font: inherit; cursor: pointer; }
select:hover { border-color: #638bb6; }
@media (forced-colors: active) { select { appearance: auto; background-image: none; } }
.filter-buttons { display: flex; gap: 12px; margin-left: auto; }
.filter-buttons .button { min-height: 44px; padding: 9px 24px; }
.small { min-height: 36px; padding: 6px 18px; font-size: 14px; }
.result-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 20px 0 12px; }
.result-toolbar p { margin: 0; }
.pagination { display: flex; gap: 8px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 940px; border-collapse: collapse; background: white; table-layout: fixed; }
.data-table th, .data-table td { border: 1px solid #bdcfe2; padding: 14px 16px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.data-table th { background: #edf4fc; color: #315778; text-align: center; font-size: 14px; font-weight: 600; height: 52px; border-bottom: 2px solid #96b9e1; }
.data-table th:first-child { width: 168px; }
.data-table th:nth-child(3) { width: 24%; }
.data-table tbody tr:nth-child(even) { background: #fcfdff; }
.data-table tbody tr:hover { background: #f0f7ff; }
.employee-table td:nth-child(n+4), .customer-table td:nth-child(4) { text-align: center; }
.data-table tbody tr.inactive-row { background: #eceef1; }
.data-table .number { text-align: center; }
.data-table .empty-state { padding: 42px; text-align: center; color: #526982; }
.result-range { font-size: 14px; margin-top: 18px; }
.edit-page { max-width: 1440px; }
.panel-heading { background: #f0f6fd; color: #285781; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 10px 10px 0 0; border-bottom: 1px solid #c4d8ec; }
.panel-body { padding: 28px; }
.section-title { border-bottom: 1px solid #bbcbdc; padding-bottom: 12px; margin: 0 0 20px; }
.form-row { margin-bottom: 24px; }
.code-field { width: 200px; }.name-field { width: 320px; }.sort-field { width: 140px; }
.password-row .control { width: 340px; }
.required { font-size: 12px; color: #af2828; margin-left: 6px; }
input[readonly] { background: #eaf0f5; color: #526982; }
.help { font-size: 14px; margin: 0 0 18px; }
.panel-body .notice { margin-bottom: 0; font-size: 14px; }
.panel-footer { border-top: 1px solid #d2dfec; padding: 18px 28px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; background: white; border-radius: 0 0 10px 10px; }
.error p { margin: 4px 0; }
.master-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.master-nav a { width: 140px; text-align: center; white-space: nowrap; }
/* メニュー追加時もログアウトだけが左下へ落ちないよう、狭い画面は二段に整列する。 */
@media (max-width: 1450px) {
    .app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; }
    .app-header .app-title { grid-column: 1; grid-row: 1; }
    .app-header .header-actions { grid-column: 2; grid-row: 1; }
    .app-header .master-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
}
@media (max-width: 920px) {
    .app-header .master-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .app-header .master-nav a { width: 100%; padding-left: 8px; padding-right: 8px; }
}
.nav-link { padding: 12px 16px; color: #46617c; text-decoration: none; border-radius: 8px; }
.nav-link:hover { background: #f0f6fd; color: #155cbd; }
.customer-table { min-width: 780px; }
.customer-table th:nth-child(3) { width: 40%; }
.project-table { min-width: 1160px; }
.project-table th:first-child { width: 90px; }
.project-table th:nth-child(2) { width: 135px; }
.project-table th:nth-child(3) { width: 25%; }
.project-table th:nth-child(6), .project-table th:nth-child(7) { width: 120px; }
.project-table th:last-child { width: 100px; }
.project-subtext { display: block; color: #60758b; font-size: 13px; margin-top: 5px; }
.status-tag { display: inline-block; padding: 4px 8px; border-radius: 5px; background: #edf0f4; color: #526070; white-space: nowrap; font-size: 13px; }
.status-1 { color: #155cbd; background: #eaf3ff; }.status-2 { color: #226548; background: #e7f5ed; }.status-3 { color: #7153a1; background: #f2edfa; }
.project-filter .filter-buttons { flex-basis: 100%; justify-content: flex-end; }
.project-basic-grid { display: grid; grid-template-columns: 220px minmax(240px,1fr) 260px; gap: 24px; margin-bottom: 24px; align-items: start; }
.project-basic-grid .control { width: 100%; }.project-customer { width: 320px; }
.project-date-row .control { width: 185px; }.project-date-row .sort-field { width: 110px; }
.project-members { display: flex; flex-wrap: wrap; gap: 12px; }
.member-choice { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #bed0e3; padding: 10px 14px; border-radius: 8px; margin: 0; cursor: pointer; background: white; }
.member-choice:has(:checked) { background: #edf5ff; border-color: #6c9fd9; }
.member-choice input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: #1769df; }
.member-choice small { display: block; color: #62788e; font-size: 12px; font-weight: 400; }
.milestone-heading { margin-top: 28px; }.milestone-table { min-width: 650px; }
.milestone-table th:first-child { width: 220px; }.milestone-table th:nth-child(3) { width: 100px; }
.milestone-table input:not([type=hidden]) { min-height: 44px; font-size: 15px; }
.milestone-add { margin-top: 12px; }.project-note { margin-top: 24px; max-width: 900px; }.project-next { margin-top: 20px; }
@media (max-width: 1000px) { .project-basic-grid { grid-template-columns: 1fr; }.project-basic-grid .control { max-width: 600px; } }
.customer-dialog { width: min(780px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 0; border: 1px solid #98adc5; border-radius: 10px; color: #1c2c42; box-shadow: 0 20px 70px #142b4d35; }
.customer-dialog::backdrop { background: #142b4d66; }
.project-tree { margin-top: 32px; scroll-margin-top: 20px; }
.project-tree h2 { margin: 0; font-size: 22px; }
.empty-tree { padding: 28px; color: #60758b; }
.class-group { margin-bottom: 20px; border: 1px solid #b9cfe6; border-radius: 10px; background: white; overflow: hidden; }
.class-group summary { padding: 18px 22px; background: #edf5ff; color: #244c75; cursor: pointer; }
.class-title { font-weight: 700; margin-left: 8px; }
.class-hours { font-size: 14px; margin-left: 8px; }
.class-state { float: right; font-size: 14px; }
.class-toolbar { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.class-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.task-table { min-width: 950px; }
.task-table th:first-child { width: 158px; }.task-table th:nth-child(2) { width: 24%; }.task-table th:nth-child(3) { width: 25%; }
.project-delete-link { margin-right: auto; }
.item-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 0; border: 1px solid #9bb9d8; border-radius: 12px; color: #202a38; box-shadow: 0 20px 70px #142b4d35; }
.item-dialog::backdrop { background: #142b4d66; }
.item-dialog .panel-heading { position: sticky; top: 0; z-index: 1; }
.item-dialog .panel-heading h2 { margin: 0; }
.item-dialog .panel-footer { position: sticky; bottom: 0; z-index: 1; }
.item-dialog .form-row { align-items: flex-start; }
.item-dialog .control { width: 190px; }.item-dialog .sort-field { width: 130px; }
.item-dialog .item-name { width: 100%; margin-bottom: 24px; }
.item-context { color: #56718e; font-size: 14px; line-height: 1.6; margin: 0 0 24px; overflow-wrap: anywhere; }
.item-note { margin-top: 24px; }.item-subheading { font-size: 16px; margin: 0 0 10px; }
.assignment-list { border: 1px solid #bdcfe2; border-radius: 8px; overflow: hidden; }
.assignment-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 16px; padding: 12px 16px; }
.assignment-row + .assignment-row { border-top: 1px solid #d5e1ee; }
.assignment-row label { margin: 0; overflow-wrap: anywhere; }.assignment-row small { display: block; color: #62788e; font-size: 12px; }
.assignment-row select { min-height: 44px; }
input:disabled { background: #f2f5f8; color: #63788d; }
@media (max-width: 600px) { .assignment-row { grid-template-columns: 1fr; gap: 8px; }.class-state { float: none; display: block; margin: 8px 0 0 24px; } }
.customer-dialog .panel-heading h2 { margin: 0; }
.dialog-close { font-size: 24px; color: #344d67; text-decoration: none; padding: 0 8px; }
.customer-basic { align-items: flex-start; }
.customer-basic .name-field { flex: 1 1 260px; }
.field-help { margin: 6px 0 0; font-size: 13px; color: #526982; }
.customer-project-count { margin-top: 28px; margin-bottom: 20px !important; }
.month-controls { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:center; gap:12px; margin:0 0 18px; }
.month-controls .button { min-height:44px; padding:10px 18px; }
.calendar-layout { display:grid; grid-template-columns:minmax(0,1fr) 330px; column-gap:24px; row-gap:0; align-items:start; }
.calendar-heading { grid-column:1; grid-row:1; }
.calendar-month-title { font-size:20px; font-weight:600; text-align:center; margin:0 0 12px; }
.calendar-month { grid-column:1; grid-row:2; min-width:0; }
.calendar-layout > .day-panel { grid-column:2; grid-row:2; }
.month-calendar { border-collapse:collapse; table-layout:fixed; width:100%; min-width:600px; background:white; }
.month-calendar th,.month-calendar td { border:1px solid #b8c1cd; }
.month-calendar th { background:#edf4fc; padding:10px; border-bottom:2px solid #96b9e1; }
.month-calendar td { vertical-align:top; height:104px; }
.day-link { display:block; height:100%; min-height:104px; padding:10px; text-decoration:none; color:inherit; overflow-wrap:anywhere; }
.day-link:hover { box-shadow:inset 0 0 0 2px #6c95d0; }
.day-number { font-weight:600; }
.day-status { display:block; margin-top:14px; font-size:13px; }
.day-name { display:block; font-size:12px; line-height:1.5; margin-top:5px; }
.sunday { color:#b52727; }.saturday { color:#285db0; }
.work-day { background:#fff; }.holiday-day { background:#fff0f0; }.unset-day { background:#eef0f3; color:#687788; }
.outside-month { background:#f5f6f8; }
.selected-day { box-shadow:inset 0 0 0 2px #356ee8; }
.today-tag { margin-left:6px; padding:2px 6px; border-radius:10px; font-size:11px; background:#dceaff; color:#214c89; display:inline-block; }
.calendar-legend { display:flex; flex-wrap:wrap; gap:18px; margin:16px 0; font-size:13px; }
.calendar-legend span { display:flex; gap:8px; align-items:center; }
.calendar-legend i { display:inline-block; width:18px; height:18px; border:1px solid #aabdd1; }
.day-panel { border:1px solid #b8c1cd; border-radius:8px; padding:24px; background:white; }
.selected-date { border-bottom:1px solid #bccbdc; padding-bottom:16px; font-weight:600; margin:0 0 22px; }
.day-panel .control { width:100%; margin-bottom:20px; }
textarea { width:100%; border:1px solid #929eae; border-radius:6px; font:inherit; padding:10px 12px; resize:vertical; }
.day-save { display:flex; justify-content:flex-end; }
.bulk-calendar { margin-top:24px; }
.bulk-help { margin:18px 0 0; }
.calendar-confirm { margin-top:24px; border-color:#658fd1; }
.confirmation-scroll { max-height:320px; overflow:auto; }
.confirmation-scroll .data-table { min-width:500px; }
.confirmation-scroll .data-table th:first-child { width:150px; }
.confirm-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:20px; }
@media(max-width:1080px) { .calendar-layout { grid-template-columns:minmax(0,1fr); } .day-panel { max-width:none; } .calendar-layout > .day-panel { grid-column:1; grid-row:3; margin-top:8px; } }
@media (max-width: 800px) {
    .master-page { padding: 22px 16px; }
    .page-heading { align-items: flex-start; flex-wrap: wrap; }
    .control, .control.keyword, .password-row .control { flex: 1 1 200px; max-width: 100%; }
    .result-toolbar { grid-template-columns: 1fr; justify-items: center; }
    .panel-heading, .panel-body, .panel-footer { padding: 20px; }
}
