* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f6fa;
  color: #1f2937;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans JP",
    sans-serif;
}

a {
  color: inherit;
}

.portal-header {
  background: #ffffff;
  border-bottom: 1px solid #dbe2ea;
}

.portal-top {
  min-height: 58px;
  background: #f97316;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.portal-brand {
  font-size: 20px;
  font-weight: 700;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.portal-user a {
  text-decoration: none;
}

.portal-user form {
  margin: 0;
}

.logout-button {
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
}

.portal-menu {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(120px, 1fr));
  min-height: 74px;
}

.portal-menu-item {
  text-decoration: none;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
}

.portal-menu-item:hover {
  background: #fff7ed;
}

.portal-menu-item.coming {
  color: #374151;
}

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.welcome-panel,
.panel,
.summary-card,
.product-note {
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
}

.welcome-panel {
  padding: 24px 28px;
  margin-bottom: 18px;
}

.welcome-panel h1 {
  margin: 0 0 6px;
  font-size: 25px;
}

.welcome-panel p {
  margin: 0;
  color: #64748b;
}

.summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 20px;
}

.summary-icon {
  font-size: 25px;
  margin-bottom: 8px;
}

.summary-label {
  color: #64748b;
  font-size: 14px;
}

.summary-value {
  margin-top: 7px;
  font-size: 22px;
  font-weight: 700;
}

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

.panel {
  padding: 22px;
  min-height: 170px;
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 18px;
}

.empty-message {
  color: #64748b;
}

.product-note {
  margin-top: 18px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}

.product-note strong {
  color: #334155;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(390px, calc(100% - 30px));
  padding: 36px;
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  box-shadow:
    0 14px 35px rgba(15, 23, 42, 0.08);
}

.login-logo {
  text-align: center;
  font-size: 42px;
}

.login-card h1 {
  text-align: center;
  margin: 8px 0 0;
}

.login-card h2 {
  text-align: center;
  margin: 3px 0 28px;
  color: #64748b;
  font-size: 17px;
  font-weight: 500;
}

.login-card label {
  display: block;
  margin: 14px 0 5px;
  font-size: 14px;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 16px;
}

.login-button {
  width: 100%;
  margin-top: 22px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.login-error {
  padding: 10px;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 6px;
  font-size: 13px;
}

@media (max-width: 800px) {

  .portal-top {
    padding: 12px 16px;
    align-items: flex-start;
  }

  .portal-user {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .portal-menu {
    grid-template-columns:
      repeat(3, 1fr);
  }

  .summary-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .product-note {
    flex-direction: column;
  }
}


/* -------------------------------------------------
   Construction
------------------------------------------------- */

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-title-row h1 {
  margin: 0;
}

.page-subtitle {
  color: #64748b;
  margin: 6px 0 0;
}

.button {
  display: inline-block;
  padding: 9px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.compact-panel {
  min-height: auto;
  margin-bottom: 16px;
}

.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-form input,
.search-form select {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}

.search-form input {
  flex: 1;
  min-width: 250px;
}

.search-form button {
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
}

.data-table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td,
.detail-table th,
.detail-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f8fafc;
  white-space: nowrap;
}

.detail-table th {
  width: 230px;
  background: #f8fafc;
}

.table-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #fff7ed;
  border-radius: 999px;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
}

.number-cell {
  text-align: right !important;
  white-space: nowrap;
}

.empty-table {
  text-align: center !important;
  color: #64748b;
  padding: 30px !important;
}

.form-section {
  min-height: auto;
  margin-bottom: 16px;
}

.form-section h2 {
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field.wide {
  grid-column: 1 / -1;
}

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

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  font: inherit;
}

.form-field select[multiple] {
  min-height: 140px;
}

.form-help {
  color: #64748b;
  font-size: 13px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 800px) {

  .page-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .detail-summary-grid {
    grid-template-columns: 1fr;
  }

  .detail-table th {
    width: 130px;
  }
}


/* -------------------------------------------------
   Schedule
------------------------------------------------- */

.week-grid {
  display: grid;
  grid-template-columns:
    repeat(7, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.week-day {
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  min-width: 150px;
  min-height: 360px;
}

.week-day.today {
  border: 2px solid #f97316;
}

.week-day.saturday
.week-day-header {
  background: #eff6ff;
}

.week-day.sunday
.week-day-header {
  background: #fef2f2;
}

.week-day-header {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.week-day-header strong {
  font-size: 17px;
}

.week-day-header span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.day-add {
  position: absolute;
  right: 8px;
  top: 8px;
  text-decoration: none;
  font-size: 20px;
  color: #2563eb;
}

.week-day-body {
  padding: 7px;
}

.schedule-item {
  display: block;
  margin-bottom: 7px;
  padding: 9px;
  border-left: 4px solid #f97316;
  border-radius: 5px;
  background: #fff7ed;
  text-decoration: none;
}

.schedule-item:hover {
  background: #ffedd5;
}

.schedule-time {
  color: #64748b;
  font-size: 11px;
}

.schedule-title {
  margin-top: 3px;
  font-weight: 700;
  font-size: 13px;
}

.schedule-person {
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
}

.schedule-empty {
  padding: 12px 5px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

@media (max-width: 1000px) {

  .week-grid {
    grid-template-columns:
      repeat(7, 155px);
  }
}


/* -------------------------------------------------
   Staff weekly schedule
------------------------------------------------- */

.staff-week-scroll {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
}

.staff-week-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
}

.staff-week-table th,
.staff-week-table td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.staff-name-col,
.staff-name-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 150px;
  min-width: 150px;
  background: #f8fafc;
}

.staff-name-col {
  padding: 14px 10px;
}

.staff-name-cell {
  padding: 14px 10px;
}

.staff-week-table thead th {
  background: #f8fafc;
  text-align: center;
  padding: 10px 6px;
}

.staff-week-date {
  font-size: 15px;
  font-weight: 700;
}

.staff-week-day {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.schedule-cell {
  position: relative;
  width: 150px;
  min-width: 150px;
  height: 120px;
  padding: 24px 6px 6px;
  background: #ffffff;
}

.cell-add {
  position: absolute;
  right: 6px;
  top: 4px;
  color: #2563eb;
  text-decoration: none;
  font-size: 17px;
}

.today-col,
.today-cell {
  background: #fff7ed !important;
}

.saturday-col,
.saturday-cell {
  background: #eff6ff;
}

.sunday-col,
.sunday-cell {
  background: #fef2f2;
}

.staff-schedule-item {
  display: block;
  margin-bottom: 5px;
  padding: 6px 7px;
  border-left: 4px solid #f97316;
  border-radius: 5px;
  background: #fff7ed;
  color: #1f2937;
  text-decoration: none;
}

.staff-schedule-item:hover {
  background: #ffedd5;
}

.staff-schedule-time {
  font-size: 10px;
  color: #64748b;
}

.staff-schedule-title {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
}

.staff-schedule-project {
  margin-top: 3px;
  font-size: 10px;
  color: #64748b;
}

.staff-schedule-item.type-internal {
  border-left-color: #64748b;
  background: #f1f5f9;
}

.staff-schedule-item.type-survey {
  border-left-color: #0ea5e9;
  background: #f0f9ff;
}

.staff-schedule-item.type-meeting {
  border-left-color: #8b5cf6;
  background: #f5f3ff;
}

.staff-schedule-item.type-maintenance {
  border-left-color: #10b981;
  background: #ecfdf5;
}

@media (max-width: 800px) {

  .staff-name-col,
  .staff-name-cell {
    width: 110px;
    min-width: 110px;
  }

  .schedule-cell {
    width: 135px;
    min-width: 135px;
  }
}


/* -------------------------------------------------
   Schedule full width
------------------------------------------------- */

.schedule-full-width {
  width: calc(100vw - 32px);
  margin-left: calc(
    50% - 50vw + 16px
  );
}

.schedule-full-width
.page-title-row {
  margin-left: 0;
  margin-right: 0;
}

.schedule-full-width
.staff-week-scroll {
  width: 100%;
}

.schedule-full-width
.staff-week-table {
  width: 100%;
  min-width: 1400px;
}

.schedule-full-width
.schedule-cell {
  min-width: 165px;
}

.schedule-full-width
.staff-name-col,
.schedule-full-width
.staff-name-cell {
  min-width: 170px;
  width: 170px;
}


/* -------------------------------------------------
   Work report photos
------------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fill,
      minmax(220px, 1fr)
    );
  gap: 16px;
}

.photo-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f1f5f9;
}

.photo-card-body {
  padding: 12px;
}

.photo-card-body p {
  margin: 7px 0;
}

.photo-type {
  display: inline-block;
  margin-bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 700;
}

.photo-meta {
  margin-top: 9px;
  color: #64748b;
  font-size: 11px;
}


/* -------------------------------------------------
   Work Report Detail v1.2
------------------------------------------------- */

.report-photo-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.report-photo-card {
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #ffffff;
}

.report-photo-link {
  display: block;
  background: #f1f5f9;
}

.report-photo-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.report-photo-body {
  padding: 10px 12px;
}

.report-photo-title {
  margin-top: 6px;
  font-weight: 700;
  font-size: 13px;
}

.report-photo-memo {
  margin-top: 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1100px) {

  .report-photo-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 800px) {

  .report-photo-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 520px) {

  .report-photo-grid {
    grid-template-columns: 1fr;
  }

}
