:root {
    --navy: #082b59;
    --blue: #1769e0;
    --blue-soft: #eaf2ff;
    --background: #f3f6fa;
    --card: #ffffff;
    --text: #182235;
    --muted: #68758a;
    --line: #dce4ef;
    --shadow: 0 18px 50px rgba(8, 43, 89, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--text);
    background:
        radial-gradient(circle at top right, #dfeeff 0, transparent 34%),
        var(--background);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

.status-card {
    width: min(620px, 100%);
    padding: clamp(26px, 5vw, 44px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.brand {
    margin: 0 0 26px;
    color: var(--navy);
    font-size: 22px;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.brand small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: 0.22em;
    opacity: 0.7;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 12px;
    font-weight: 800;
}

h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.25;
}

.message {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

.ready {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid #b9ddc9;
    border-radius: 14px;
    color: #17663a;
    background: #effaf4;
    font-size: 14px;
    font-weight: 750;
}

.ready::before {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #24a35a;
    content: "";
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 11px;
    color: #ffffff;
    background: var(--blue);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
}

.button:hover,
.button:focus-visible {
    background: #0e55bd;
}

.version {
    margin-top: 28px;
    color: #8a96a8;
    font-size: 12px;
}

.auth-card,
.dashboard-shell {
    width: min(680px, 100%);
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.auth-card.wide,
.dashboard-shell {
    width: min(920px, 100%);
}

.back-link,
.sub-actions a,
.help-text a {
    color: var(--blue);
    font-weight: 750;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    text-decoration: none;
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #3f4b5f;
    font-size: 13px;
    font-weight: 800;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #c9d5e4;
    border-radius: 11px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
}

.field input:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(23, 105, 224, 0.14);
}

.field small,
.help-text {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.button.full {
    width: 100%;
    justify-content: center;
}

.button.secondary {
    color: #ffffff;
    background: var(--navy);
}

.button.muted-button {
    color: #3b4a60;
    background: #edf1f6;
}

.notice {
    margin-top: 20px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.65;
}

.notice ul {
    margin: 0;
    padding-left: 20px;
}

.notice.error {
    border-color: #f0b9b9;
    color: #8b2424;
    background: #fff1f1;
}

.notice.warning {
    border-color: #ead09a;
    color: #73500c;
    background: #fff8e8;
}

.notice.success {
    border-color: #b9ddc9;
    color: #17663a;
    background: #effaf4;
}

.portal-grid,
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 26px;
}

.portal-card {
    display: grid;
    gap: 7px;
    min-height: 145px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--text);
    background: #fbfdff;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-card:hover,
.portal-card:focus-visible {
    border-color: #9dbfea;
    box-shadow: 0 10px 28px rgba(23, 105, 224, 0.11);
    transform: translateY(-2px);
}

.portal-card strong {
    color: var(--navy);
    font-size: 20px;
}

.portal-card small {
    align-self: end;
    color: var(--muted);
    line-height: 1.5;
}

.portal-label,
.muted-label {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.sub-actions {
    margin-top: 22px;
    text-align: center;
}

.check-list {
    display: grid;
    gap: 8px;
    margin-top: 22px;
}

.check-list div {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.dashboard-header .brand {
    margin-bottom: 18px;
}

.welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fbff;
}

.welcome-card h2 {
    margin: 5px 0;
    color: var(--navy);
}

.welcome-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.role-badge {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 12px;
    font-weight: 800;
}

.feature-card {
    display: grid;
    gap: 7px;
    min-height: 100px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

.feature-card strong {
    color: var(--navy);
}

.feature-card span {
    align-self: end;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 640px) {
    body {
        align-items: start;
        padding: 14px;
    }

    .status-card,
    .auth-card,
    .dashboard-shell {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .field-grid,
    .portal-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header,
    .welcome-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Application shell */
.app-body {
    display: block;
    min-height: 100vh;
    padding: 0;
    background: #f4f7fb;
}

.app-frame {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 28px 20px;
    color: #fff;
    background: linear-gradient(180deg, #082b59, #071f3e);
}

.app-logo {
    color: #fff;
    text-decoration: none;
}

.app-logo strong { display: block; font-size: 21px; }
.app-logo small { display: block; margin-top: 2px; font-size: 9px; letter-spacing: .24em; opacity: .65; }
.area-label { margin-top: 20px; color: #9dc5f5; font-size: 12px; font-weight: 800; }

.app-nav { display: grid; gap: 5px; margin-top: 20px; }
.app-nav a { padding: 11px 13px; border-radius: 10px; color: #cfdded; font-size: 14px; font-weight: 700; text-decoration: none; }
.app-nav a:hover, .app-nav a.active { color: #fff; background: rgba(255,255,255,.13); }
.sidebar-user { display: grid; gap: 3px; margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255,255,255,.16); }
.sidebar-user span { color: #aabbd0; font-size: 12px; }

.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; text-decoration: underline; }
.sidebar-user .text-button { margin-top: 8px; color: #dce9f8; }

.app-main { min-width: 0; width: min(1240px, 100%); margin: 0 auto; padding: 34px clamp(22px, 4vw, 54px) 70px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-header h1 { font-size: clamp(26px, 4vw, 36px); }
.page-header .eyebrow { margin-bottom: 7px; }

.hero-panel, .detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px;
    border: 1px solid #d6e2f1;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff, #eef5ff);
    box-shadow: 0 12px 34px rgba(8,43,89,.07);
}
.hero-panel h2, .detail-hero h2 { margin: 5px 0 6px; color: var(--navy); font-size: clamp(22px, 3vw, 30px); }
.hero-panel p, .detail-hero p { margin: 0; color: var(--muted); }
.worker-hero { align-items: stretch; }
.attendance-box { display: grid; min-width: 260px; align-content: center; gap: 8px; padding: 18px; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(8,43,89,.08); }
.attendance-box strong { color: var(--navy); font-size: 20px; }
.attendance-box span { color: var(--muted); font-size: 13px; }

.button.compact { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.button.ghost { border: 1px solid #bfd0e5; color: var(--navy); background: #fff; }
.button.success-button { background: #178349; }
.button.danger-button { background: #b43535; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button-stack { display: grid; gap: 9px; margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }

.section-block { margin-top: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 14px; }
.section-heading h2 { margin: 4px 0 0; color: var(--navy); font-size: 22px; }
.section-heading p { margin: 0; color: var(--muted); }
.section-heading > a { color: var(--blue); font-weight: 800; text-decoration: none; }

.schedule-list { display: grid; gap: 12px; }
.schedule-card { display: flex; align-items: center; gap: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.schedule-card.today { border-color: #9bbff1; box-shadow: 0 8px 25px rgba(23,105,224,.08); }
.schedule-card h3 { margin: 6px 0 3px; color: var(--navy); }
.schedule-card p { margin: 0; color: var(--muted); font-size: 13px; }
.date-tile { display: grid; width: 55px; height: 55px; place-content: center; border-radius: 13px; color: #fff; background: var(--navy); text-align: center; }
.date-tile strong { font-size: 17px; }.date-tile span { font-size: 10px; opacity: .75; }
.tag { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }

.empty-state { display: grid; gap: 6px; padding: 40px 20px; border: 1px dashed #c6d2e2; border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.65); text-align: center; }
.empty-state strong { color: var(--navy); }

.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.filter-bar.inline { margin: 0; padding: 0; border: 0; background: transparent; }
.filter-bar label { display: grid; gap: 5px; color: #46546a; font-size: 12px; font-weight: 800; }
.filter-bar input, .filter-bar select { min-height: 40px; padding: 8px 10px; border: 1px solid #c9d5e4; border-radius: 9px; background: #fff; font: inherit; }
.search-field { flex: 1; min-width: 230px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.site-card, .quick-links a { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: #fff; text-decoration: none; box-shadow: 0 8px 25px rgba(8,43,89,.04); }
.site-card:hover, .quick-links a:hover { border-color: #9dbfea; transform: translateY(-1px); }
.site-card h2 { margin: 11px 0 7px; color: var(--navy); font-size: 19px; }
.site-card p { min-height: 40px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.link-arrow { display: block; margin-top: 16px; color: var(--blue); font-size: 13px; font-weight: 800; }

.two-column { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.two-column.equal { grid-template-columns: repeat(2, minmax(0,1fr)); }
.two-column > div, .two-column > aside { display: grid; gap: 16px; }
.content-card, .table-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(8,43,89,.045); }
.content-card h2 { margin: 0 0 17px; color: var(--navy); font-size: 19px; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 145px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid #e8edf3; }
.detail-list > div:first-child { border-top: 0; }.detail-list dt { color: var(--muted); font-size: 12px; font-weight: 800; }.detail-list dd { margin: 0; line-height: 1.7; }
.file-list, .compact-list { display: grid; gap: 8px; }
.file-list a, .compact-list a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fbfdff; text-decoration: none; }
.file-list a { flex-direction: column; }.file-list small, .compact-list small { color: var(--muted); }.compact-list a > span { display: grid; gap: 3px; }.compact-list em { align-self: center; color: var(--blue); font-size: 12px; font-style: normal; font-weight: 800; }

.table-card { padding: 0; overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e8edf3; text-align: left; vertical-align: middle; }
th { color: #5d6b80; background: #f7f9fc; font-size: 12px; white-space: nowrap; }
td { font-size: 13px; } td small { display: block; margin-top: 3px; color: var(--muted); }
td a { color: var(--blue); font-weight: 800; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #45556c; background: #edf1f5; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-submitted { color: #80550a; background: #fff3d5; }.status-approved { color: #17663a; background: #e7f7ee; }.status-returned { color: #972f2f; background: #ffe8e8; }.status-draft { color: #596579; background: #edf1f5; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-top: 20px; }
.stats-grid a { padding: 18px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: #fff; text-decoration: none; }
.stats-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }.stats-grid strong { display: inline-block; margin-top: 8px; color: var(--navy); font-size: 30px; }.stats-grid small { margin-left: 4px; color: var(--muted); }
.quick-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; margin-top: 28px; }.quick-links strong, .quick-links span { display: block; }.quick-links strong { color: var(--navy); }.quick-links span { margin-top: 6px; color: var(--muted); font-size: 12px; }

.form-card { padding: 26px; }
.form-card fieldset { margin: 0; padding: 0 0 28px; border: 0; }.form-card fieldset + fieldset { padding-top: 25px; border-top: 1px solid var(--line); }
.form-card legend { width: 100%; margin-bottom: 17px; color: var(--navy); font-size: 19px; font-weight: 850; }.form-card legend small { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.form-grid { display: grid; gap: 15px; }.form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }.form-grid .span-two { grid-column: span 2; }
.form-card label, .approval-card label { display: grid; gap: 7px; color: #46546a; font-size: 12px; font-weight: 800; }
.form-card label > span b { color: #c63838; font-size: 10px; }.form-card input, .form-card select, .form-card textarea, .approval-card textarea, .inline-create input, .inline-create select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9d5e4; border-radius: 10px; background: #fff; color: var(--text); font: inherit; }.form-card textarea, .approval-card textarea { resize: vertical; line-height: 1.6; }.form-card input:focus, .form-card select:focus, .form-card textarea:focus { border-color: var(--blue); outline: 3px solid rgba(23,105,224,.12); }.form-card label small { color: var(--muted); font-weight: 500; }
.full-field { margin-top: 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.check-card { display: flex !important; align-items: center; gap: 9px !important; min-height: 48px; padding: 10px 12px; border: 1px solid #d5deea; border-radius: 10px; background: #fbfcfe; }.check-card:has(input:checked) { border-color: #75a9ec; background: #eef5ff; }.check-card input { width: 17px; min-height: 17px; flex: 0 0 17px; }.check-card span { display: grid; gap: 2px; }.check-card small { font-size: 10px; }
.toggle-field { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; padding: 15px; border-radius: 11px; background: #f4f8fd; }.toggle-field input { width: 18px; min-height: 18px; }
.sticky-actions { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(8,43,89,.12); backdrop-filter: blur(8px); }
.upload-list { display: grid; gap: 8px; }.upload-row { display: grid; grid-template-columns: 1fr 140px; gap: 8px; }.photo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.photo-card { display: grid; gap: 7px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #fff; text-decoration: none; }.photo-card img { width: 100%; aspect-ratio: 4/3; border-radius: 7px; object-fit: cover; background: #edf1f5; }.photo-card span { font-size: 12px; font-weight: 800; }.photo-card small { color: #8b2424; font-size: 11px; }.existing-photos { margin-bottom: 15px; }
.timeline { display: grid; gap: 0; }.timeline > div { position: relative; display: grid; gap: 3px; padding: 0 0 18px 18px; border-left: 2px solid #d7e1ee; }.timeline > div::before { position: absolute; top: 2px; left: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); content: ''; }.timeline span { color: var(--muted); font-size: 11px; }.timeline p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.inline-create { display: grid; grid-template-columns: 130px 1fr 80px auto; gap: 7px; margin-bottom: 15px; }.master-list { display: grid; }.master-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }.master-list span { display: grid; gap: 2px; }.master-list small { color: var(--muted); }

/* Printable report */
.print-body { display: block; padding: 22px; background: #e8edf3; }
.print-toolbar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; }.print-toolbar span { color: #526078; font-size: 12px; }
.report-sheet { width: 210mm; min-height: 297mm; margin: auto; padding: 13mm; color: #172236; background: #fff; box-shadow: 0 10px 35px rgba(0,0,0,.14); }
.report-title { display: flex; align-items: end; justify-content: space-between; padding-bottom: 8mm; border-bottom: 3px solid #082b59; }.report-title span { color: #1769e0; font-size: 10px; font-weight: 900; letter-spacing: .18em; }.report-title h1 { margin: 2mm 0 0; font-size: 26px; }.report-title dl { margin: 0; font-size: 10px; }.report-title dl div { display: grid; grid-template-columns: 55px 1fr; gap: 5px; }.report-title dt { color: #637087; }.report-title dd { margin: 0; }
.report-info { margin-top: 7mm; border: 1px solid #9aa7b8; }.report-info th, .report-info td { padding: 3mm; border: 1px solid #9aa7b8; font-size: 10px; }.report-info th { width: 26mm; color: #203a5c; background: #edf3f9; }.notes-cell { min-height: 14mm; }
.report-photos { margin-top: 7mm; }.report-photos h2 { margin: 0 0 4mm; padding-left: 3mm; border-left: 4px solid #1769e0; color: #082b59; font-size: 15px; }.print-photo-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 4mm; }.print-photo-grid figure { margin: 0; border: 1px solid #9aa7b8; }.print-photo-grid img { display: block; width: 100%; height: 48mm; object-fit: cover; }.report-sheet.eightphotos .print-photo-grid img { height: 29mm; }.print-photo-grid figcaption { padding: 2mm; font-size: 9px; }.report-footer { display: flex; justify-content: space-between; margin-top: 7mm; padding-top: 3mm; border-top: 1px solid #9aa7b8; font-size: 9px; }

@media (max-width: 980px) {
    .app-frame { grid-template-columns: 190px minmax(0,1fr); }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .card-grid { grid-template-columns: repeat(2,1fr); }
    .choice-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
    html, body.app-body { max-width: 100%; overflow-x: hidden; }
    .app-frame { display: block; }
    .app-sidebar { position: static; width: 100%; height: auto; padding: 16px; }
    .app-logo, .area-label, .sidebar-user { display: none; }
    .app-nav { grid-template-columns: repeat(4,1fr); margin: 0; overflow-x: auto; }
    .app-nav a { padding: 9px 8px; text-align: center; white-space: nowrap; }
    .app-main { padding: 22px 14px 55px; }
    .page-header, .section-heading, .hero-panel, .detail-hero { align-items: flex-start; flex-direction: column; }
    .worker-hero { display: grid; }.attendance-box { width: 100%; min-width: 0; }
    .two-column, .two-column.equal, .card-grid, .quick-links { grid-template-columns: 1fr; }
    .form-grid.two, .choice-grid { grid-template-columns: 1fr; }.form-grid .span-two { grid-column: span 1; }
    .schedule-card { align-items: flex-start; flex-wrap: wrap; }.schedule-card .card-actions { display: flex; width: 100%; justify-content: flex-end; }
    .detail-list > div { grid-template-columns: 100px 1fr; }
    .photo-grid { grid-template-columns: 1fr; }
    .upload-row { grid-template-columns: 1fr; }
    .inline-create { grid-template-columns: 1fr 1fr; }
    .sticky-actions { flex-wrap: wrap; }.sticky-actions .button { flex: 1; justify-content: center; }

    /* 作業員用の報告一覧は、狭い画面では表をカード表示にする。 */
    .worker-area .table-card {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .worker-area .responsive-table { overflow: visible; }
    .worker-area .responsive-table table,
    .worker-area .responsive-table tbody,
    .worker-area .responsive-table tr,
    .worker-area .responsive-table td {
        display: block;
        width: 100%;
    }
    .worker-area .responsive-table thead { display: none; }
    .worker-area .responsive-table tbody { display: grid; gap: 12px; }
    .worker-area .responsive-table tr {
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 8px 25px rgba(8,43,89,.045);
    }
    .worker-area .responsive-table td {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid #e8edf3;
        overflow-wrap: anywhere;
    }
    .worker-area .responsive-table td::before {
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }
    .worker-area .responsive-table td:nth-child(1)::before { content: "作業日"; }
    .worker-area .responsive-table td:nth-child(2)::before { content: "現場"; }
    .worker-area .responsive-table td:nth-child(3)::before { content: "作業員"; }
    .worker-area .responsive-table td:nth-child(4)::before { content: "写真"; }
    .worker-area .responsive-table td:nth-child(5)::before { content: "状態"; }
    .worker-area .responsive-table td:last-child {
        display: block;
        padding: 14px 0 0;
        border-bottom: 0;
    }
    .worker-area .responsive-table td:last-child::before { display: none; }
    .worker-area .responsive-table td:last-child a {
        display: flex;
        min-height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid #bfd0e5;
        border-radius: 10px;
        color: var(--navy);
        background: #fff;
        text-decoration: none;
    }
}

@media print {
    @page { size: A4 portrait; margin: 0; }
    .print-body { padding: 0; background: #fff; }
    .print-toolbar { display: none !important; }
    .report-sheet { width: 210mm; min-height: 297mm; margin: 0; box-shadow: none; }
}

/* 出面・売上採算管理 */
.management-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.management-toolbar h2 { margin: 0 0 6px; color: var(--navy); font-size: 22px; }
.management-toolbar p, .card-heading p, .form-guidance { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.management-toolbar .filter-bar { flex: 0 0 auto; margin: 0; }
.management-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.management-stats article { min-width: 0; padding: 18px; border: 1px solid var(--line); background: #fff; }
.management-stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.management-stats strong { display: inline-block; margin-top: 8px; color: var(--navy); font-size: clamp(22px, 3vw, 30px); overflow-wrap: anywhere; }
.management-stats small { margin-left: 4px; color: var(--muted); }
.management-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.management-primary { min-width: 0; padding: 0; overflow: hidden; }
.management-primary .card-heading { padding: 22px 22px 0; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-heading h2, .management-form h2 { margin: 0 0 6px; color: var(--navy); font-size: 19px; }
.management-form { position: sticky; top: 20px; }
.management-form .form-guidance { margin-bottom: 18px; padding: 11px; border-left: 3px solid var(--blue); background: var(--blue-soft); }
.management-form .full-button { display: flex; width: 100%; justify-content: center; margin-top: 16px; }
.management-form .full-button + .full-button { margin-top: 8px; }
.compact-empty { padding: 22px 16px; }
.management-details { padding: 0; overflow: hidden; }
.management-details > summary { padding: 18px 22px; color: var(--navy); cursor: pointer; font-weight: 850; }
.management-details[open] > summary { border-bottom: 1px solid var(--line); }
.management-details .responsive-table { margin-top: 0; }
.danger-text, .negative-value { color: #b4232f !important; }
.positive-value { color: #167345 !important; }
.profitability-table table { min-width: 1280px; }
.worker-cost-details { min-width: 145px; }
.worker-cost-details summary { color: var(--blue); cursor: pointer; font-weight: 800; white-space: nowrap; }
.worker-cost-details > div { display: grid; min-width: 250px; gap: 7px; margin-top: 9px; padding: 10px; border: 1px solid var(--line); background: #f8fbff; }
.worker-cost-details p { display: grid; gap: 2px; margin: 0; }
.worker-cost-details p + p { padding-top: 7px; border-top: 1px solid #e2eaf4; }
.worker-cost-details p span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.priority-priority { color: #0b5fc6; background: #e5f0ff; }
.priority-normal { color: #17663a; background: #e7f7ee; }
.priority-review { color: #972f2f; background: #ffe8e8; }
.calculation-note { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--blue); color: var(--muted); background: #eef5ff; font-size: 12px; }
.calculation-note strong { color: var(--navy); }

@media (max-width: 1100px) {
    .management-grid { grid-template-columns: 1fr; }
    .management-form { position: static; }
}

@media (max-width: 760px) {
    .management-toolbar { align-items: stretch; flex-direction: column; }
    .management-toolbar .filter-bar { width: 100%; }
    .management-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .management-stats article { padding: 14px; }
    .management-stats strong { font-size: 22px; }
    .management-primary .card-heading { padding: 18px 16px 0; }
    .calculation-note { display: grid; }

    /* 管理画面：一覧表を横に潰さず、項目名付きのカードとして表示する。 */
    .admin-area .section-heading > .button {
        width: 100%;
        justify-content: center;
    }
    .admin-area .filter-bar {
        width: 100%;
    }
    .admin-area .filter-bar.inline {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .admin-area .filter-bar.inline label,
    .admin-area .search-field {
        min-width: 0;
    }
    .admin-area .table-card {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .admin-area .responsive-table {
        overflow: visible;
    }
    .admin-area .mobile-card-table,
    .admin-area .mobile-card-table tbody,
    .admin-area .mobile-card-table tr {
        display: block;
        width: 100%;
    }
    .admin-area .mobile-card-table {
        min-width: 0;
    }
    .admin-area .mobile-card-table thead {
        display: none;
    }
    .admin-area .mobile-card-table tbody {
        display: grid;
        gap: 12px;
    }
    .admin-area .management-primary .mobile-card-table tbody {
        padding: 0 16px 16px;
    }
    .admin-area .mobile-card-table tr {
        border: 1px solid var(--line);
        background: #fff;
        box-shadow: 0 8px 25px rgba(8,43,89,.045);
    }
    .admin-area .mobile-card-table td {
        display: grid;
        width: 100%;
        grid-template-columns: 100px minmax(0, 1fr);
        align-items: start;
        gap: 12px;
        padding: 10px 12px;
        border-bottom: 1px solid #e8edf3;
        line-height: 1.6;
        overflow-wrap: break-word;
        word-break: normal;
    }
    .admin-area .mobile-card-table td::before {
        color: var(--muted);
        content: attr(data-mobile-label);
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
    }
    .admin-area .mobile-card-table td:last-child {
        border-bottom: 0;
    }
    .admin-area .mobile-card-table td[data-mobile-action="true"] {
        display: block;
        padding-top: 14px;
    }
    .admin-area .mobile-card-table td[data-mobile-action="true"]::before {
        display: none;
    }
    .admin-area .mobile-card-table td[data-mobile-action="true"] form {
        margin: 0;
    }
    .admin-area .mobile-card-table td[data-mobile-action="true"] a,
    .admin-area .mobile-card-table td[data-mobile-action="true"] .text-button {
        display: flex;
        width: 100%;
        min-height: 42px;
        align-items: center;
        justify-content: center;
        padding: 9px 12px;
        border: 1px solid #bfd0e5;
        color: var(--navy);
        background: #fff;
        text-decoration: none;
    }
    .admin-area .worker-cost-details,
    .admin-area .worker-cost-details > div {
        min-width: 0;
    }
}

/*
 * Button label contrast
 *
 * Some link-specific rules (for example, links inside .section-heading)
 * are intentionally blue.  A link that is also rendered as a filled button
 * must keep a white label, regardless of the surrounding component.
 */
.button:not(.ghost):not(.muted-button) {
    color: #ffffff;
}

/* Client design request: use square corners throughout the application. */
* {
    border-radius: 0 !important;
}
