/* ===== なび助 新レイアウト（B案） =====
   テーマ色は :root の --primary-color / --secondary-color / --primary-light を使用 */

:root {
  --nv-side-bg: color-mix(in srgb, var(--secondary-color) 72%, #0d1b1a);
  --nv-tint: color-mix(in srgb, var(--primary-color) 10%, #ffffff);
  --nv-ink: #24262e;
  --nv-muted: #5c6070;
  --nv-line: #e6e8ef;
  --nv-bg: #f6f7fb;
  --nv-yellow: #ffd84d;
  --nv-radius: 20px;
  --nv-side-w: 236px;
}

body.nv-body {
  margin: 0;
  background: var(--nv-bg);
  color: var(--nv-ink);
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}

.nv-shell { display: flex; min-height: 100vh; }

/* ---------- サイドバー ---------- */
.nv-side {
  position: sticky; top: 0;
  flex: 0 0 var(--nv-side-w);
  width: var(--nv-side-w);
  height: 100vh;
  overflow-y: auto;
  background: var(--nv-side-bg);
  color: #fff;
  padding: 20px 14px 28px;
  box-sizing: border-box;
  z-index: 1040;
}
.nv-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 20px;
  color: #fff; text-decoration: none;
}
.nv-brand:hover { color: #fff; }
.nv-brand-mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 50%;
  background: #fff; color: var(--secondary-color);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px;
}
.nv-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nv-brand-name { font-weight: 800; font-size: 19px; }
.nv-brand-sub { font-size: 10.5px; opacity: .85; letter-spacing: .03em; }
.nv-side-close { display: none; }

.nv-nav { display: flex; flex-direction: column; gap: 3px; }
.nv-group {
  font-size: 11px; font-weight: 700; opacity: .8;
  padding: 16px 14px 4px; letter-spacing: .08em;
}
.nv-side .nv-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  color: #fff; text-decoration: none;
  font-weight: 700; font-size: 14px;
  transition: background .15s;
  cursor: pointer;
}
.nv-side .nv-link i { width: 18px; text-align: center; opacity: .9; }
.nv-side .nv-link:hover { background: rgba(255,255,255,.14); color: #fff; }
.nv-side .nv-link.is-active { background: #fff; color: var(--nv-ink); font-weight: 800; }
.nv-side .nv-link.is-active i { color: var(--secondary-color); opacity: 1; }
.nv-label { flex: 1; }

.nv-badge {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px;
  background: var(--nv-yellow); color: #3a2d00;
  font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}

.nv-admin summary { list-style: none; }
.nv-admin summary::-webkit-details-marker { display: none; }
.nv-caret { font-size: 11px; transition: transform .15s; }
.nv-admin[open] .nv-caret { transform: rotate(180deg); }
.nv-sub { display: flex; flex-direction: column; padding: 4px 0 6px 42px; }
.nv-sub a {
  color: #fff; opacity: .88; text-decoration: none;
  font-size: 13px; padding: 7px 8px; border-radius: 10px;
}
.nv-sub a:hover { opacity: 1; background: rgba(255,255,255,.12); color: #fff; }

/* ---------- 本文側 ---------- */
.nv-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.nv-top {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  background: rgba(246,247,251,.92);
  backdrop-filter: blur(6px);
}
.nv-top-brand { display: none; }
.nv-top-spacer { flex: 1; }

.nv-user { position: relative; }
.nv-user summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 2px solid var(--nv-line);
  border-radius: 999px; padding: 4px 14px 4px 4px;
  font-weight: 800; font-size: 14px; min-height: 44px; box-sizing: border-box;
}
.nv-user summary::-webkit-details-marker { display: none; }
.nv-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--nv-tint); color: var(--nv-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.nv-user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px; background: #fff;
  border: 2px solid var(--nv-line); border-radius: 16px;
  box-shadow: 0 12px 30px rgba(30,40,60,.12);
  padding: 8px; z-index: 1050;
}
.nv-user-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--nv-ink); text-decoration: none; font-weight: 700; font-size: 14px;
}
.nv-user-menu a i { width: 16px; color: var(--nv-muted); }
.nv-user-menu a:hover { background: var(--nv-tint); }
.nv-user-menu hr { margin: 6px 4px; border-color: var(--nv-line); opacity: 1; }

.nv-main { flex: 1 0 auto; padding: 8px 0 32px; }
.nv-main > .container { max-width: 1280px; width: 100%; padding-left: 24px; padding-right: 24px; }

.nv-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 24px; padding: 18px 0 22px;
  border-top: 2px dashed var(--nv-line);
  font-size: 11px; color: #6b6f7d;
}
.nv-footer img { height: 20px; width: auto; opacity: .75; }

.nv-tabbar, .nv-scrim, .nv-top-menu { display: none; }

/* ---------- 既存部品をポップに寄せる（色は変えず形だけ） ---------- */
.nv-body .card {
  border: 2px solid #eceef4;
  border-radius: var(--nv-radius);
  box-shadow: none;
  overflow: hidden;
}
.nv-body .card-header { border-bottom: 2px solid #eceef4; font-weight: 800; }
.nv-body .btn { border-radius: 999px; font-weight: 700; }
.nv-body .form-control, .nv-body .form-select { border-radius: 12px; }
.nv-body .badge { border-radius: 8px; }
.nv-body .alert { border-radius: 16px; border-width: 2px; }

/* ---------- スマホ・タブレット（992px未満） ---------- */
@media (max-width: 991.98px) {
  .nv-side {
    position: fixed; right: 0; left: auto; top: 0; bottom: 0; height: auto;
    width: min(300px, 86vw);
    transform: translateX(105%);
    transition: transform .22s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,.2);
  }
  .nv-top-menu {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: none; border-radius: 12px;
    background: rgba(255,255,255,.18); color: #fff; font-size: 19px;
  }
  body.nv-drawer-open .nv-side { transform: translateX(0); }
  body.nv-drawer-open { overflow: hidden; }
  .nv-scrim {
    display: block; position: fixed; inset: 0; z-index: 1035;
    background: rgba(15,20,30,.4);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.nv-drawer-open .nv-scrim { opacity: 1; pointer-events: auto; }
  .nv-side-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 18px; right: 12px;
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.15); color: #fff; font-size: 18px;
  }

  .nv-top { background: var(--nv-side-bg); color: #fff; padding: 8px 14px; }
  .nv-top-brand {
    display: flex; align-items: center; gap: 8px;
    color: #fff; text-decoration: none; font-weight: 800; font-size: 17px;
  }
  .nv-top-brand .nv-brand-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 16px; }
  .nv-user summary { border: none; background: rgba(255,255,255,.18); color: #fff; padding: 4px; }
  .nv-user-name, .nv-user summary .nv-caret { display: none; }
  .nv-avatar { background: #fff; }

  .nv-main { padding-bottom: 96px; }
  .nv-main > .container { padding-left: 14px; padding-right: 14px; }
  .nv-footer { margin: 0 14px 84px; flex-direction: column; justify-content: center; }
  .nv-footer img { height: 15px; }

  .nv-tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: #fff; border-top: 2px solid var(--nv-line);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .nv-tabbar .nv-link {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-height: 48px; padding: 4px 0;
    background: none; border: none;
    color: var(--nv-muted); text-decoration: none;
    font-family: inherit; font-size: 10.5px; font-weight: 700;
  }
  .nv-tabbar .nv-link i { font-size: 19px; }
  .nv-tabbar .nv-link .nv-label { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nv-tabbar .nv-link.is-active { color: var(--nv-side-bg); font-weight: 800; }
  .nv-tabbar .nv-badge {
    position: absolute; top: -2px; left: 50%; margin-left: 4px;
    min-width: 18px; height: 18px; font-size: 10px; border: 2px solid #fff;
  }
}

@media print {
  .nv-side, .nv-top, .nv-tabbar, .nv-footer, .nv-scrim { display: none !important; }
  .nv-main { padding: 0; }
}

/* ---------- なび助ロゴ ---------- */
.nv-brand { padding: 4px 8px 22px; }
.nv-brand-logo { display: block; height: 54px; width: auto; }
.nv-top-brand img { display: block; height: 34px; width: auto; }

/* ===== 幅と位置をそろえる（上部バー・本文・フッターを同じ最大幅に） 2026-11-03 ===== */
@media (min-width: 992px) {
  .nv-top {
    padding-left: max(24px, calc((100% - 1440px) / 2 + 24px));
    padding-right: max(24px, calc((100% - 1440px) / 2 + 24px));
  }
  .nv-main > .container { max-width: 1440px; }
  .nv-footer {
    margin-left: max(24px, calc((100% - 1440px) / 2 + 24px));
    margin-right: max(24px, calc((100% - 1440px) / 2 + 24px));
  }
}

/* ===== 本文を左に寄せる（余白は右側だけ）・スケジュールは画面いっぱい 2026-11-03 ===== */
@media (min-width: 992px) {
  .nv-top { padding-left: 32px; padding-right: 32px; }
  .nv-main > .container { max-width: 1680px; margin-left: 0; margin-right: auto; padding-left: 32px; padding-right: 32px; }
  .nv-footer { margin-left: 32px; margin-right: 32px; max-width: 1616px; }
  body.nv-wide .nv-main > .container { max-width: none; }
  body.nv-wide .nv-footer { max-width: none; }
}
