/**
 * デジタル庁ダッシュボードの明快さ × Apple の余白・質感
 * Bootstrap 5 変数を上書き
 */
:root {
  --bs-body-font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --bs-body-bg: #f5f5f7;
  --bs-body-color: #1d1d1f;
  --bs-secondary-color: #6e6e73;
  --bs-tertiary-color: #86868b;

  /* デジタル庁ブルー系（画面全体では控えめに使う） */
  --bs-primary: #0017c1;
  --bs-primary-rgb: 0, 23, 193;
  --bs-link-color: #0017c1;
  --bs-link-hover-color: #000a7a;

  --bs-success: #0b7a45;
  --bs-success-rgb: 11, 122, 69;
  --bs-danger: #b42318;
  --bs-danger-rgb: 180, 35, 24;
  --bs-warning: #9a6700;
  --bs-info: #0b6e99;

  --bs-border-color: #e5e5ea;
  --bs-border-radius: 12px;
  --bs-border-radius-lg: 16px;
  --bs-box-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --bs-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);

  --app-surface: #ffffff;
  --app-header-border: rgba(0, 0, 0, 0.08);
  --app-focus-ring: rgba(0, 23, 193, 0.22);
  --app-max: 68rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.app-body {
  background:
    radial-gradient(1200px 480px at 50% -120px, rgba(0, 23, 193, 0.06), transparent 60%),
    var(--bs-body-bg);
  color: var(--bs-body-color);
  letter-spacing: 0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-banner-plan {
  background: #fff;
  border-bottom: 1px solid var(--app-header-border);
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
  text-align: center;
  padding: 0.55rem 1rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--app-header-border);
}

.app-header-inner {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
  color: #1d1d1f !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-brand-mark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--bs-primary);
  box-shadow: 0 0 0 4px rgba(0, 23, 193, 0.12);
}

.app-brand-text {
  font-size: 1.05rem;
}

.app-nav {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.app-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.app-nav-link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: #3a3a3c !important;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.9375rem;
}

.app-nav-link:hover,
.app-nav-link:focus {
  background: rgba(0, 23, 193, 0.06);
  color: var(--bs-primary) !important;
}

.app-nav-actions {
  margin-left: auto;
}

.app-nav-toggle {
  margin-left: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
}

.app-nav-toggle .navbar-toggler-icon {
  filter: invert(0.3);
}

@media (max-width: 991.98px) {
  .app-nav.collapse:not(.show) {
    display: none !important;
  }

  .app-nav.show {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .app-nav-list {
    flex-direction: column;
  }

  .app-nav-actions {
    margin-left: 0;
  }
}

/* Main */
.app-main {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

.app-adsense {
  margin: 0 0 1.25rem;
  min-height: 90px;
  overflow: hidden;
  text-align: center;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-primary);
  letter-spacing: 0.04em;
}

.page-title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0.35rem 0 0;
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
}

/* Auth */
.auth-shell {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
  padding: 1rem 0 2rem;
}

.auth-card {
  width: min(100%, 26rem);
  background: var(--app-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  box-shadow: var(--bs-box-shadow);
  padding: 2rem 1.75rem;
}

.auth-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-primary);
  letter-spacing: 0.04em;
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-lead {
  margin: 0 0 1.5rem;
  color: var(--bs-secondary-color);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.auth-footer {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.auth-footer a {
  text-decoration: none !important;
  color: var(--bs-primary) !important;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline !important;
}

/* Dashboard tiles */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.dash-tile {
  position: relative;
  display: block;
  background: var(--app-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.35rem;
  text-decoration: none !important;
  color: inherit !important;
  box-shadow: var(--bs-box-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--bs-box-shadow);
}

.dash-tile.is-disabled {
  opacity: 0.72;
}

.dash-tile-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.dash-tile-text {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
  line-height: 1.55;
}

.dash-panel,
.dash-upgrade,
.dash-billing {
  background: var(--app-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--bs-box-shadow-sm);
}

.dash-upgrade {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-color: rgba(0, 23, 193, 0.18);
  background: linear-gradient(180deg, #fff, #f7f8ff);
}

.dash-kv {
  margin: 0;
}

.dash-kv > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  font-size: 0.9rem;
}

.dash-kv dt {
  margin: 0;
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.dash-kv dd {
  margin: 0;
  word-break: break-all;
}

/* Cards / Bootstrap overrides */
.card {
  background: var(--app-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: var(--bs-box-shadow-sm);
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--bs-border-color);
  font-weight: 600;
}

.btn {
  font-weight: 600;
  border-radius: 980px;
  letter-spacing: 0.01em;
  padding: 0.55rem 1.15rem;
}

.btn-sm {
  border-radius: 980px;
  padding: 0.35rem 0.85rem;
}

.btn-lg {
  border-radius: 980px;
  padding: 0.75rem 1.25rem;
}

.btn-primary {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #000a7a;
  border-color: #000a7a;
}

.btn-outline-primary {
  color: var(--bs-primary);
  border-color: rgba(0, 23, 193, 0.28);
}

.btn-outline-primary:hover {
  background: rgba(0, 23, 193, 0.06);
  color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--bs-border-color);
  color: #3a3a3c;
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: #d2d2d7;
  color: #1d1d1f;
}

.form-control,
.form-select {
  border-radius: 12px;
  border-color: #d2d2d7;
  padding: 0.65rem 0.85rem;
  background-color: #fff;
}

/* Bootstrap の矢印用余白を潰さない（padding 一括指定の打ち消し） */
.form-select {
  padding-right: 2.25rem;
  background-position: right 0.75rem center;
}

.form-control-sm {
  border-radius: 10px;
  padding: 0.28rem 0.55rem;
  font-size: 0.875rem;
  min-height: calc(1.5em + 0.56rem + 2px);
}

.form-select-sm {
  border-radius: 10px;
  padding: 0.28rem 1.85rem 0.28rem 0.55rem;
  font-size: 0.875rem;
  min-height: calc(1.5em + 0.56rem + 2px);
  background-position: right 0.5rem center;
  background-size: 14px 10px;
}

.form-control-lg {
  border-radius: 14px;
  padding: 0.8rem 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #8a9ad8;
  box-shadow: 0 0 0 0.2rem var(--app-focus-ring);
}

.form-label {
  font-weight: 550;
  font-size: 0.875rem;
  color: #3a3a3c;
  margin-bottom: 0.4rem;
}

.alert {
  border-radius: 14px;
  border: 1px solid transparent;
}

.alert-success {
  --bs-alert-bg: #f1faf4;
  --bs-alert-border-color: #d5ecde;
  --bs-alert-color: #14532d;
}

.alert-danger {
  --bs-alert-bg: #fff5f5;
  --bs-alert-border-color: #f0d6d6;
  --bs-alert-color: #7f1d1d;
}

.alert-info {
  --bs-alert-bg: #f3f8fc;
  --bs-alert-border-color: #d7e6f1;
  --bs-alert-color: #0c4a6e;
}

.table-light {
  --bs-table-bg: #fafafa;
  --bs-table-border-color: var(--bs-border-color);
}

thead.table-light th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: #3a3a3c;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4 {
  color: #1d1d1f;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.text-muted,
.text-secondary {
  color: var(--bs-secondary-color) !important;
}

.form-section {
  margin-bottom: 1.75rem;
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: #1d1d1f;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.form-section .form-label {
  font-weight: 550;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .travel-report-form .field-narrow {
    max-width: 20rem;
  }
}

.trip-schedule-row .form-control,
.trip-schedule-row .form-select,
.trip-schedule-row .trip-summary-box {
  width: 100%;
  max-width: 100%;
}

.trip-summary-box {
  min-height: calc(1.5em + 0.75rem + 2px);
  font-size: 0.875rem;
  line-height: 1.5;
}

input.report-date-synced {
  cursor: not-allowed;
}

.app-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--bs-border-color);
  background: #fff;
  border-radius: 980px;
  padding: 0.25rem 0.7rem 0.25rem 0.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #1d1d1f;
}

.app-user-chip::after {
  margin-left: 0.15rem;
}

.app-user-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: rgba(0, 23, 193, 0.1);
  color: var(--bs-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.nav-pills .nav-link {
  border-radius: 980px;
  color: #3a3a3c;
  font-weight: 600;
}

.nav-pills .nav-link.active {
  background: var(--bs-primary);
}

  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid var(--app-header-border) !important;
  backdrop-filter: blur(12px);
}

.app-navbar .navbar-brand {
  font-weight: 700;
  color: #1d1d1f !important;
}

.app-navbar .nav-link {
  color: #3a3a3c !important;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.45rem 0.75rem !important;
}

.app-navbar .nav-link:hover {
  background: rgba(0, 23, 193, 0.06);
  color: var(--bs-primary) !important;
}

.app-card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--bs-border-color) !important;
  font-weight: 600;
}

/* 単価設定マトリクス */
.rates-intro {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.rates-matrix-card {
  margin-bottom: 0.85rem;
}

.rates-matrix-card .card-header {
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
}

.rates-matrix {
  --bs-table-cell-padding-y: 0.35rem;
  --bs-table-cell-padding-x: 0.65rem;
  font-size: 0.875rem;
}

.rates-matrix > :not(caption) > * > * {
  padding: 0.35rem 0.65rem;
  vertical-align: middle;
}

.rates-matrix thead th {
  white-space: nowrap;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.rates-matrix .rates-region,
.rates-matrix .rates-trip {
  width: 5.5rem;
  white-space: nowrap;
  color: #3a3a3c;
}

.rates-matrix .rates-input {
  max-width: 9rem;
  text-align: right;
}

.rates-matrix .rates-empty {
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
}
