* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #f5f6f8;
  color: #1f2933;
  font-family: 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

/* 安全側の非表示（古いブラウザ/リセットCSS対策） */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

/* ヘッダーとメニューボタン高さの同期用変数 */
:root {
  --ui-header-height: 60px;
}

.ui-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  min-height: var(--ui-header-height);
  padding: 0 1.5rem;
  /*background: linear-gradient(135deg, #3a7bd5, #00d2ff);*/
  color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ui-header__title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.ui-header__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.ui-header__brand-link:hover {
  opacity: 0.92;
}

.ui-header__brand-logo {
  width: 34px;
  height: auto;
  display: block;
}

.ui-header__brand-text {
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.ui-header__nav {
  display: flex;
  gap: 0.75rem;
}

.ui-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ui-nav-link:hover {
  transform: translateY(-1px);
  background-color: rgba(255, 255, 255, 0.25);
}

.ui-nav-link.is-active {
  background-color: #ffffff;
  color: #1f2933;
  border-color: rgba(15, 23, 42, 0.12);
}

.ui-header__greeting {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.header_greeting {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #2663eb;
  text-align: center;
}

.header_greeting::before {
  content: '\f007';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 6px;
}

.ui-main {
  padding: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.ui-panel {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.ui-panel__title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.ui-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ui-panel__header .ui-button {
  flex: 0 1 auto;
  max-width: 12rem;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.ui-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.ui-form__field {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.ui-form__label {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: #475569;
}

.ui-form--vertical {
  flex-direction: column;
  align-items: stretch;
}

.ui-form__actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.ui-form__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.ui-form input[type='date'],
.ui-form input[type='email'],
.ui-form input[type='password'],
.ui-input,
.ui-select {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
}

.ui-form input:focus {
  border-color: #3a7bd5;
  outline: none;
  box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.2);
}

.ui-select {
  appearance: none;
  background-color: #ffffff;
}

.ui-textarea {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  /* font-size: 1rem; */
  resize: vertical;
  min-height: 120px;
}

.ui-textarea:focus {
  border-color: #3a7bd5;
  outline: none;
  box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.2);
}

.ui-textarea--table {
  width: 100%;
  min-height: 80px;
  /* font-size: 0.85rem; */
}

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  /* font-size: 0.95rem; */
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ui-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.35);
}

.ui-button--primary {
  background: linear-gradient(135deg, #3a7bd5, #3ed8ff);
  color: #ffffff;
}

.ui-button--primary:hover {
  transform: translateY(-1px);
}

.ui-button--secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.ui-button--secondary:hover {
  transform: translateY(-1px);
}

.ui-button--ghost {
  background-color: transparent;
  color: #1f2933;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.ui-button--danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #ffffff;
}

.ui-button--inline {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.ui-table-container {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background-color: #ffffff;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
}

.ui-table th,
.ui-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-table th {
  background-color: #f1f5f9;
  color: #1e293b;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ui-table__placeholder td {
  text-align: center;
  color: #64748b;
}

.ui-table__spacer td {
  padding: 0;
  border: none;
  height: 0;
  line-height: 0;
}

.ui-table td:nth-child(4) {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.ui-table td:not(:nth-child(4)) {
  white-space: nowrap;
}

.ui-approval-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

.ui-table__row--pending {
  opacity: 0.6;
}

.ui-status {
  margin-bottom: 0.75rem;
  /* font-size: 0.9rem; */
  color: #1e293b;
}

.ui-status--error {
  color: #dc2626;
}

.ui-status--success {
  color: #16a34a;
}

.ui-result {
  transition: opacity 0.2s ease;
}

.ui-result.is-hidden {
  opacity: 0;
  visibility: hidden;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.ui-definition {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.ui-definition dt {
  font-weight: 600;
  color: #475569;

  /* Daily report page */
  .daily-report__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .daily-report__breadcrumb {
    font-size: 0.9rem;
    color: #475569;
  }

  .daily-report__breadcrumb a {
    color: inherit;
    text-decoration: none;
  }

  .daily-report__breadcrumb a:hover {
    text-decoration: underline;
  }

  .daily-report__context {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
  }

  .daily-report__context-separator {
    margin: 0 0.35rem;
    color: #94a3b8;
  }

  .daily-report__status {
    min-width: 180px;
    text-align: right;
  }

  .daily-report__filters {
    margin-top: 0.5rem;
  }

  .daily-report__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .daily-report__schedule {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    background-color: #ffffff;
  }

  .daily-report__schedule textarea {
    width: 100%;
    resize: vertical;
  }

  /* Utility styles reused by the daily report JS renderer */
  .card {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  }

  .card-body {
    padding: 1rem 1.25rem;
  }

  .mb-2 {
    margin-bottom: 0.75rem !important;
  }

  .mt-2 {
    margin-top: 0.75rem !important;
  }

  .p-2 {
    padding: 0.75rem !important;
  }

  .small {
    font-size: 0.85rem;
  }

  .fw-bold {
    font-weight: 600;
  }

  .text-muted {
    color: #64748b !important;
  }

  .text-danger {
    color: #dc2626 !important;
  }

  .d-flex {
    display: flex;
  }

  .gap-2 {
    gap: 0.5rem;
  }

  .form-control,
  .form-select,
  .form-control-sm {
    width: 100%;
    border: 1px solid #cbd5f5;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    background-color: #ffffff;
  }

  .form-control-sm {
    font-size: 0.85rem;
    padding: 0.45rem 0.65rem;
  }

  .form-control:focus,
  .form-select:focus,
  .form-control-sm:focus {
    border-color: #3a7bd5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.2);
  }

  .form-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
  }

  .form-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .form-check-input {
    width: 1rem;
    height: 1rem;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    accent-color: #3a7bd5;
  }

  .form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.2);
  }

  .form-check-input:checked {
    border-color: #3a7bd5;
  }
}

.ui-definition dd {
  margin: 0;
  word-break: break-all;
}

.ui-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

/* .ui-login__panel {
  width: 100%;
  max-width: 360px;
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.15);
} */

.ui-login__title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  text-align: center;
}

.ui-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.ui-logout__panel {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.ui-logout__title {
  margin: 0 0 0.5rem;
}

@media (max-width: 640px) {
  :root {
    --ui-header-height: 50px;
  }

  .ui-form {
    flex-direction: column;
    align-items: stretch;
  }

  .ui-form__field {
    width: 100%;
  }

  .ui-button {
    width: 100%;
  }

  .ui-panel__header .ui-button {
    flex: 1 1 auto;
    max-width: none;
    white-space: normal;
  }

  .ui-header {
    flex-direction: column;
    gap: 1rem;
  }

  .ui-panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .ui-approval-actions {
    flex-direction: column;
    align-items: stretch;
  }

.ui-nav-link {
  width: 100%;
  justify-content: center;
}
}

/* 承認済み表示 */
.calendarMain .schedule-block.is-approved {
  position: relative;
}
.calendarMain .schedule-approved-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #16a34a;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 210;
}
