/* ===== Valuebox SaaS mock CSS — 現行valuebox（Materio系）トークン版 ===== */
/* style.css と同じクラス名で、配色・角丸・影・フォント・バッジを現行の実値に差し替え */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

:root{
  --vb-primary:#9055fd; --vb-primary-dark:#7e3ff2;
  --vb-grad:linear-gradient(45deg,#9055fd,#c8aafe);
  --vb-secondary:#8a8d93; --vb-success:#56ca00; --vb-info:#16b1ff;
  --vb-warning:#ffb400; --vb-danger:#ff4c51;
  --vb-body:#f4f5fa; --vb-card:#fff; --vb-heading:#544f5a; --vb-text:#89868d;
  --vb-border:#e7e7e8; --vb-radius:.375rem; --vb-btn-radius:.3125rem;
  --vb-shadow:0 .375rem 1rem 0 rgba(58,53,65,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter','Noto Sans JP', sans-serif;
  background: #f5f4fb;
  min-height: 100vh;
  color: var(--vb-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* 一番下のレイヤー：薄いテックグリッド（全ページ共通） */
body::before{
  content:''; position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(144,85,253,.08) 1px,transparent 1px),
    linear-gradient(90deg,rgba(144,85,253,.08) 1px,transparent 1px);
  background-size:44px 44px;
}
a { color: inherit; text-decoration: none; }

/* ===== client navbar (slim, top only) ===== */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(7.5px);
  border-bottom: 1px solid var(--vb-border);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--vb-heading);
  letter-spacing: .3px;
}
.nav-logo-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--vb-grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.nav-tenant {
  font-size: 11px; color: var(--vb-text);
  padding: 4px 10px; background: #f2ebff; border-radius: 6px;
  margin-left: 8px;
}
.nav-tenant.staff { background: #eee6ff; color: var(--vb-primary); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-link {
  font-size: 15px; color: var(--vb-heading); font-weight: 500;
  padding: 8px 12px; border-radius: var(--vb-btn-radius);
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-link i { font-size: 15px; opacity: .85; }
.nav-link.active i { opacity: 1; }
.nav-link:hover { background: #f2ebff; color: var(--vb-primary); }
.nav-link.active { background: linear-gradient(270deg,#9055fd 0%,#c4a5fe 100%); color: #fff; font-weight: 600; }
.nav-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--vb-heading); font-weight: 500;
  cursor: pointer;
}
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #eee6ff; color: var(--vb-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
img.nav-avatar { object-fit: cover; border: 2px solid #efeaf9; }
/* お知らせベル（全ページ共通） */
.nav-bell { position: relative; display: inline-flex; align-items: center; color: #89868d; cursor: pointer; padding: 6px; }
.nav-bell i { font-size: 17px; }
.nav-bell:hover { color: var(--vb-primary); }
.nav-dot { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: #ff4c51; border: 1.5px solid #fff; }
/* グロナビ：スマホ対応（ハンバーガー＋右スライドドロワー・全ページ共通） */
.nav-menu { display: inline-flex; align-items: center; gap: 10px; }
.nav-drawer-head { display: none; }
.nav-drawer-foot { display: none; }
.nav-burger { display: none; background: none; border: none; cursor: pointer; color: #544f5a; font-size: 20px; line-height: 1; padding: 7px 9px; border-radius: 9px; }
.nav-burger:hover { background: #f2ecff; color: #7c5cfc; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(24,18,48,.42); z-index: 90; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.nav-backdrop.show { opacity: 1; visibility: visible; }
@media (max-width:1400px){
  .nav-menu { position: fixed; top: 0; right: 0; height: 100dvh; width: min(82vw,300px); flex-direction: column; align-items: stretch; gap: 4px; background: #fff; box-shadow: -16px 0 44px rgba(64,52,120,.28); padding: 70px 14px 22px; transform: translateX(106%); transition: transform .3s cubic-bezier(.4,0,.2,1); z-index: 95; overflow-y: auto; }
  .nav-menu.open { transform: translateX(0); }
  .nav-menu .nav-link { font-size: 15px; padding: 13px 14px; border-radius: 11px; }
  .nav-menu .nav-link i { width: 22px; text-align: center; font-size: 16px; opacity: 1; }
  .nav-drawer-head { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; margin-bottom: 8px; border-bottom: 1px solid #f1f0f6; }
  .nav-dh-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid #efeaf9; flex-shrink: 0; }
  .nav-dh-txt { display: flex; flex-direction: column; min-width: 0; }
  .nav-dh-nm { font-size: 14px; font-weight: 800; color: #544f5a; }
  .nav-dh-role { font-size: 11px; color: #89868d; }
  .nav-dh-close { margin-left: auto; background: none; border: none; cursor: pointer; color: #89868d; font-size: 19px; padding: 4px 8px; border-radius: 8px; flex-shrink: 0; }
  .nav-dh-close:hover { background: #f2ecff; color: #7c5cfc; }
  .nav-drawer-foot { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 12px; border-top: 1px solid #f1f0f6; }
  .nav-df-badge { margin-left: auto; background: #ff4c51; color: #fff; font-size: 10px; font-weight: 800; min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 10px; }
  .nav-logout { color: #ff4c51; }
  .nav-logout i { color: #ff4c51; opacity: 1; }
  .nav-logout:hover { background: #fff0f1; }
  .nav-burger { display: inline-flex; align-items: center; }
  .nav-user { font-size: 0; gap: 0; }
  .navbar { padding: 0 16px; }
}
@media (max-width:430px){ .nav-tenant { display: none; } }

/* ===== staff layout (sidebar + main) ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #fff; color: var(--vb-heading);
  padding: 24px 0; flex-shrink: 0; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; border-right: 1px solid var(--vb-border);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px 24px; border-bottom: 1px solid var(--vb-border);
  margin-bottom: 16px;
}
.sidebar-brand-text { font-size: 16px; font-weight: 700; color: var(--vb-heading); }
.sidebar-section {
  font-size: 10px; font-weight: 700; color: var(--vb-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 12px 24px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; font-size: 14px; color: var(--vb-heading);
  transition: all 0.15s; border-radius: 6px; margin: 0 8px;
}
.sidebar-link:hover { background: #f2ebff; color: var(--vb-primary); }
.sidebar-link.active {
  background: linear-gradient(270deg,#9055fd 0%,#c4a5fe 100%); color: #fff;
}
.sidebar-link .badge {
  margin-left: auto; background: var(--vb-danger); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 700;
}
.sidebar-link .icon { width: 16px; text-align: center; opacity: 0.7; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: rgba(255,255,255,0.9); backdrop-filter: blur(7.5px);
  border-bottom: 1px solid var(--vb-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--vb-heading); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.search-input {
  width: 260px; padding: 8px 12px; font-size: 14px;
  border: 1px solid var(--vb-border); border-radius: var(--vb-btn-radius);
  background: #fff;
}
.search-input:focus { outline: none; border-color: var(--vb-primary); }

/* ===== page ===== */
.page { max-width: 1320px; margin: 0 auto; padding: 32px; width: 100%; position: relative; z-index: 1; }
.page-narrow { max-width: 760px; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--vb-heading); }
.page-subtitle { font-size: 14px; color: var(--vb-text); margin-top: 4px; }

/* ===== cards ===== */
.card {
  background: var(--vb-card); border-radius: 16px;
  border: 1px solid #ece7fa;
  box-shadow: 0 8px 26px rgba(102,80,164,.10), 0 0 34px rgba(144,85,253,.14), 0 0 0 1px rgba(144,85,253,.07);
  padding: 22px 24px; margin-bottom: 22px;
}
.card.dense { padding: 16px; }
.card-title {
  font-size: 16px; font-weight: 700; color: var(--vb-heading);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--vb-border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-title-text { display: flex; align-items: center; gap: 8px; }

/* ===== stats grid ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--vb-card); border-radius: 16px;
  border: 1px solid #ece7fa;
  box-shadow: 0 8px 26px rgba(102,80,164,.10), 0 0 34px rgba(144,85,253,.14), 0 0 0 1px rgba(144,85,253,.07);
  padding: 20px;
}
.stat-label { font-size: 13px; color: var(--vb-text); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--vb-heading); line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--vb-text); margin-top: 6px; }
.stat-sub.up { color: var(--vb-success); }
.stat-sub.down { color: var(--vb-danger); }

/* ===== forms ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--vb-heading); margin-bottom: 6px;
}
.form-label .required { color: var(--vb-danger); font-size: 11px; margin-left: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid #d1d5db; border-radius: var(--vb-btn-radius);
  font-size: 15px; font-family: inherit;
  transition: border-color 0.15s;
  background: #fff;
}
.form-select {
  padding-right: 32px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8d93' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--vb-primary);
  box-shadow: 0 0 0 3px rgba(144,85,253,0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 11px; color: var(--vb-text); margin-top: 4px; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .4375rem 1.375rem; border-radius: var(--vb-btn-radius);
  font-size: 15px; font-weight: 700; border: none;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg,#8266f4,#a488fb); color: #fff; box-shadow: 0 4px 12px rgba(124,92,252,.28); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(124,92,252,.42); }
.btn-blue { background: var(--vb-info); color: #fff; }
.btn-blue:hover { filter: brightness(0.94); }
.btn-green { background: var(--vb-success); color: #fff; }
.btn-green:hover { filter: brightness(0.94); }
.btn-red { background: var(--vb-danger); color: #fff; }
.btn-red:hover { filter: brightness(0.94); }
.btn-outline {
  background: #fff; color: var(--vb-primary);
  border: 1px solid var(--vb-primary);
}
.btn-outline:hover { background: #f2ebff; }
.btn-ghost { background: transparent; color: var(--vb-text); }
.btn-ghost:hover { background: #f2ebff; color: var(--vb-primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row.right { justify-content: flex-end; }

/* ===== tags / status badges (= Sneat .bg-label-*) ===== */
.tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--vb-radius); vertical-align: middle;
}
.tag-blue   { background: #dcf3ff; color: #16b1ff; }  /* info */
.tag-cyan   { background: #eee6ff; color: #9055fd; }  /* primary */
.tag-green  { background: #e6f7d9; color: #56ca00; }  /* success */
.tag-yellow { background: #fff4d9; color: #ffb400; }  /* warning */
.tag-orange { background: #ffe6d1; color: #e07b39; }
.tag-red    { background: #ffe4e5; color: #ff4c51; }  /* danger */
.tag-purple { background: #eee6ff; color: #9055fd; }  /* primary */
.tag-gray   { background: #edeeef; color: #8a8d93; }  /* secondary */

/* ===== tables ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 10px 14px; font-weight: 600;
  color: var(--vb-heading); font-size: 0.75rem; border-bottom: 1px solid var(--vb-border);
  background: transparent; text-transform: uppercase; letter-spacing: 1px;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--vb-border); color: #4b4b4b;
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(58,53,65,0.04); cursor: pointer; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .amount { text-align: right; font-weight: 600; }

/* ===== chat thread ===== */
.chat-thread {
  background: #f4f5fa; border-radius: var(--vb-radius); padding: 16px;
  max-height: 520px; overflow-y: auto;
}
.chat-msg { display: flex; gap: 10px; margin-bottom: 14px; }
.chat-msg.me { flex-direction: row-reverse; }
.chat-msg.system { justify-content: center; }
.chat-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.chat-avatar.client { background: #dcf3ff; color: #16b1ff; }
.chat-avatar.staff  { background: #e6f7d9; color: #56ca00; }
.chat-avatar.ai     { background: #eee6ff; color: #9055fd; }
.chat-bubble {
  background: #fff; padding: 10px 14px; border-radius: var(--vb-radius);
  max-width: 75%; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--vb-border);
}
.chat-msg.me .chat-bubble { background: #f2ebff; border-color: #ddceff; }
.chat-msg.ai .chat-bubble { background: #f7f2ff; border-color: #e5d6ff; }
.chat-meta {
  font-size: 10px; color: var(--vb-text); margin-top: 4px;
  display: flex; gap: 8px; align-items: center;
}
.chat-msg.me .chat-meta { justify-content: flex-end; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.chat-input textarea {
  flex: 1; padding: 10px 12px; border: 1px solid var(--vb-border);
  border-radius: var(--vb-radius); font-family: inherit; font-size: 14px;
  resize: none; min-height: 70px;
}
.chat-input textarea:focus { outline: none; border-color: var(--vb-primary); }

/* ===== diff viewer (AI review) ===== */
.diff-viewer {
  background: #2f2b3a; color: #e7e3f4; border-radius: var(--vb-radius);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px; line-height: 1.65; padding: 16px; overflow-x: auto;
}
.diff-line { white-space: pre; padding: 0 6px; }
.diff-add { background: rgba(86,202,0,0.18); color: #a6e878; }
.diff-del { background: rgba(255,76,81,0.18); color: #ff9ea1; }
.diff-ctx { color: #a29bb8; }

/* ===== timeline ===== */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--vb-border);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: ''; position: absolute; left: -19px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--vb-primary);
}
.timeline-item.done::before { background: var(--vb-success); border-color: var(--vb-success); }
.timeline-item.pending::before { background: #fff; border-color: #cbd5e1; }
.timeline-time { font-size: 11px; color: var(--vb-text); margin-bottom: 2px; }
.timeline-text { font-size: 14px; color: #4b4b4b; }

/* ===== login screen ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: linear-gradient(135deg, #f3ecff 0%, #f4f5fa 60%, #ede6ff 100%);
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: var(--vb-radius);
  padding: 36px 32px;
  box-shadow: var(--vb-shadow);
  border: 0;
}
.login-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.login-brand-mark {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--vb-grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(144,85,253,0.3);
}
.login-brand-title { font-size: 18px; font-weight: 700; color: var(--vb-heading); }
.login-brand-sub { font-size: 12px; color: var(--vb-text); margin-top: 2px; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0; font-size: 11px; color: var(--vb-text);
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--vb-border);
}

/* ===== misc utilities ===== */
.muted { color: var(--vb-text); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.bold { font-weight: 700; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-sm { gap: 6px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-md { margin-bottom: 16px; }
.flex-1 { flex: 1; }
.divider { height: 1px; background: var(--vb-border); margin: 16px 0; }

/* ===== responsive ===== */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
