/* ===========================================
   見積ウツシくん — styles.css
   ブランディング指示書 改訂1 (2026-06-12) 準拠
   =========================================== */

/* ---- トークン ---- */
:root {
  --bg:              #F5F4F0;
  --surface:         #FFFFFF;
  --border:          #E5E7EB;
  --text:            #1F2937;
  --heading:         #042C53;
  --muted:           #6B7280;
  --accent:          #185FA5;    /* うつし紺：リンク・フォーカス・プライマリUI */
  --accent-light:    #E6F1FB;    /* うすぞら */
  --accent-mid:      #378ADD;    /* そらいろ */
  --cta:             #BA7517;    /* くん色・濃：CTAボタン背景専用 */
  --cta-hover:       #854F0B;
  --cta-badge:       #EF9F27;    /* くん色・明：バッジ・ロゴ装飾 */
  --cta-badge-text:  #412402;
  --danger:          #C0392B;
  --success:         #16A34A;
  --radius:          10px;
  --radius-lg:       14px;
  --safe-bottom:     max(12px, env(safe-area-inset-bottom, 0px));
  --mobile-bar-h:    56px;
  --workflow-header-h: 40px;
  --margin-mobile-bar-h: 70px;
}

/* ---- リセット ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.page-body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  min-height: 100vh;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
}

/* ================================================================
   ヘッダー
   ================================================================ */

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sync-warning {
  background: #FEF3C7;
  border-bottom: 1px solid #F59E0B;
  color: #92400E;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 16px;
  text-align: center;
}

.sync-warning[hidden] {
  display: none;
}

.monitor-revoke-banner {
  background: linear-gradient(180deg, #FFF8EB 0%, #FFF3E0 100%);
  border-bottom: 1px solid #E8B86D;
  padding: 16px 20px;
}

.monitor-revoke-banner[hidden] {
  display: none;
}

.monitor-revoke-banner-inner {
  max-width: 920px;
  margin: 0 auto;
}

.monitor-revoke-banner-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #7A4A10;
}

.monitor-revoke-banner-text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.75;
  color: #5C4A32;
}

.monitor-revoke-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.monitor-revoke-banner-cta {
  min-width: 220px;
}

.monitor-revoke-notice {
  margin-bottom: 20px;
  padding: 18px 20px;
  background: #FFF8EB;
  border: 1.5px solid #E8B86D;
  border-radius: var(--radius-lg);
}

.monitor-revoke-notice-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #7A4A10;
}

.monitor-revoke-notice-lead {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #5C4A32;
}

.monitor-revoke-notice-body {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.75;
  color: #444;
}

.monitor-revoke-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 42px;
  width: auto;
  display: block;
}
@media screen and (max-width: 480px) {
  .logo-img {
    height: 34px;
  }
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  flex-shrink: 0;
  min-width: 0;
}

.header-badges-desktop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.header-hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--heading);
  border-radius: 1px;
}

.header-hamburger[aria-expanded="true"] .header-hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header-hamburger[aria-expanded="true"] .header-hamburger-bar:nth-child(2) {
  opacity: 0;
}

.header-hamburger[aria-expanded="true"] .header-hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header-hamburger-bar {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 44, 83, 0.35);
  z-index: 140;
}

.header-mobile-backdrop[hidden] {
  display: none;
}

.header-mobile-menu {
  position: fixed;
  top: 60px;
  right: 0;
  width: min(280px, 88vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.1);
  padding: 16px;
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.26s ease;
}

.header-mobile-menu[hidden] {
  display: none;
}

.header-mobile-menu.is-open {
  transform: translateX(0);
}

.header-mobile-menu-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.header-mobile-menu-badges .header-plan-badge,
.header-mobile-menu-badges .header-usage-badge {
  width: fit-content;
}

.header-mobile-menu-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}

.header-mobile-menu-item:hover {
  background: var(--bg);
}

.header-mobile-menu-primary {
  font-weight: 700;
  color: var(--accent);
}

.header-mobile-menu-logout {
  color: var(--danger);
}

.header-mobile-menu-logout:hover {
  background: #fdf2f1;
}

.header-plan-badge,
.header-usage-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}

.header-plan-badge--trial {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.header-plan-badge--paid {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid #FCD34D;
}

.header-usage-badge {
  background: #E6F1FB;
  color: #0C447C;
  border: 1px solid #B5D4F4;
}

.header-usage-badge--read {
  background: #EEF2FF;
  color: #4338CA;
  border-color: #C7D2FE;
}

.header-usage-badge--print {
  background: #E6F1FB;
  color: #0C447C;
  border-color: #B5D4F4;
}

.header-usage-badge--warn {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  line-height: 1.3;
}

.header-user-id {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.header-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.header-login-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.header-avatar-slot {
  flex-shrink: 0;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.usage-badge {
  display: none;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ================================================================
   ページ切り替え
   ================================================================ */

.page {
  display: none;
}

.page.active {
  display: block;
  animation: utsushiPageIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page.page-leaving {
  display: none;
}

@keyframes utsushiPageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes utsushiPageOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page.active {
    animation: none;
  }
}

/* ================================================================
   共通ボタン・アクション行
   ================================================================ */

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-back {
  padding: 16px 24px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-back:hover {
  background: var(--bg);
}

.btn-output {
  flex: 1;
  padding: 16px;
  background: var(--cta);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-output:hover {
  background: var(--cta-hover);
}

.btn-excel {
  flex: 1;
  padding: 16px;
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-excel:hover {
  background: var(--accent-light);
}

.btn-preview {
  flex: 1;
  padding: 16px;
  background: var(--cta);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-preview:hover {
  background: var(--cta-hover);
}

.btn-mypage {
  padding: 10px 18px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-mypage:hover {
  background: var(--bg);
}

/* ---- 管理画面・フォーム共通 ---- */
.page-body--admin {
  background: #F0F0F1;
  color: #1A1A18;
  font-size: 14px;
  line-height: 1.7;
}

.page-body.is-menu-open {
  overflow: hidden;
}

.text-link--admin {
  color: #185FA5;
  text-decoration: none;
}
.text-link--admin:hover {
  text-decoration: underline;
}

.form-input,
.form-select {
  padding: 8px 10px;
  border: 1px solid #8C8F94;
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

.form-input--text,
.form-input--number,
.form-input--datetime {
  min-width: 160px;
}

.form-input--full {
  width: 100%;
  min-width: 0;
}

.btn-primary {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: #2271B1;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover {
  background: #135E96;
}
.btn-primary:disabled,
.btn-primary.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 8px 14px;
  border: 1px solid #2271B1;
  border-radius: 4px;
  background: #fff;
  color: #2271B1;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #F6F7F7;
}
.btn-secondary:disabled,
.btn-secondary.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger {
  background: #B32D2E;
  border: 1px solid #B32D2E;
  color: #fff;
}
.btn-danger:hover {
  background: #8f2425;
  border-color: #8f2425;
}

.btn-pagination {
  min-width: 36px;
  padding: 6px 10px;
}
.btn-pagination.is-current {
  background: #1D2327;
  border-color: #1D2327;
  color: #fff;
}

@media screen and (max-width: 768px) {
  .form-input--text,
  .form-input--number,
  .form-input--datetime,
  .form-input--email {
    width: 100%;
    min-width: 0;
  }

  .btn-pagination {
    min-width: 32px;
    padding: 6px 8px;
    font-size: 12px;
  }
}

@media screen and (max-width: 480px) {
  .btn-primary {
    padding: 10px 12px;
    font-size: 14px;
  }

  .btn-small {
    padding: 6px 8px;
    font-size: 11px;
  }
}

