body,
:is(.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6),
.navbar-menu .navbar-nav .nav-link {
    font-family: 'Noto Sans JP', sans-serif;
}

select {
    cursor: pointer;
}

.font-size-13px { font-size: 13px; }
.font-size-12px { font-size: 12px; }
.font-size-11px { font-size: 11px; }
.font-size-16px { font-size: 16px; }

.min-width-156px { min-width: 156px; }
.border-radius-8px { border-radius: 8px; }

.btn-primary {
    background: #1a6cf5;
    color: #fff;
}

.btn-logout:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.card { border-radius: 16px; }

/* ── Global border-radius: softer look to match modal roundness ─── */
.form-control,
.form-select {
    border-radius: 10px;
}
.btn {
    border-radius: 10px;
}
/* Select2(bootstrap-5テーマ)は独自CSSで角丸(.25rem)を持つため、他input/selectと揃える。
   select2-bootstrap-5-theme.min.css がこのファイルより後に読み込まれるため !important が必要。 */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 10px !important;
}
.mgmt-modal .btn {
    font-weight: 700;
}

.card-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(26,108,245,.08);
    overflow: hidden;
}

.required::after {
    content: '*';
    color: red;
}

/* Required field badge — use <span class="label-required">必須</span> inside labels */
.label-required {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.optional::after {
    content: '(任意)';
    --vz-text-opacity: 1;
    color: var(--vz-secondary-color) !important;
    margin-left: 2px;
}

/** Flatpickr Custom Styles */
.flatpickr-months .flatpickr-month {
    color: rgba(255, 255, 255, 0.9) !important;
}
.flatpickr-weekdays {
    background: #6691e7 !important;
    border-bottom: none !important;
    height: 36px !important;
}
span.flatpickr-weekday {
    background: #6691e7 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    font-size: 1rem !important;
}
.flatpickr-months .flatpickr-next-month,
.flatpickr-months .flatpickr-prev-month {
    padding: 5px 10px !important;
    color: rgba(255, 255, 255, .9) !important;
    fill: rgba(255, 255, 255, .9) !important;
}
/** ./ Flatpickr Custom Styles */

/** Select2 Custom Styles */
.select2-container--bootstrap-5 .select2-selection--single {
    padding: .5rem .9rem !important;
}
.select2-container--bootstrap-5 .select2-selection {
    padding-left: 0 !important;
}
.select2-container .select2-selection--single {
    padding-left: 0 !important;
    font-size: .825rem !important;
    height: 38px !important;
}
.select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 14px !important;
    font-size: .825rem !important;
    height: 38px !important;
}
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option {
    font-size: .825rem !important;
}
/** ./ Select2 Custom Styles */

/** Password show/hide toggle */
.password-addon {
    right: 0;
    top: 0;
    color: #64748b;
    cursor: pointer;
    z-index: 5;
}
.password-addon:hover { color: #1a6cf5; }
.position-relative input.is-invalid ~ .password-addon {
    right: 20px;
    top: -10px;
}
/** ./ Password show/hide toggle */

/* ── Dark green sidebar ───────────────────────────────────────────── */
.app-menu {
    background-color: #1a2a1a !important;
}
.app-menu .sidebar-background {
    background-color: #1a2a1a !important;
}
.app-menu .navbar-nav .nav-link,
.app-menu .navbar-nav .menu-link {
    color: rgba(255, 255, 255, 0.65) !important;
}
.app-menu .navbar-nav .nav-link:hover,
.app-menu .navbar-nav .menu-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.07) !important;
}
/* ── sm mode (768-1024px): compact custom sidebar elements ──────── */

/* Brand box: center icon only, hide name/sub/arrow */
[data-sidebar-size=sm] .navbar-brand-box {
    padding: 0 !important;
    justify-content: center !important;
}
[data-sidebar-size=sm] .mgmt-brand-current {
    flex: unset;
    padding: 8px;
    border: none;
    background: transparent !important;
    justify-content: center;
    gap: 0;
}
[data-sidebar-size=sm] .mgmt-brand-info,
[data-sidebar-size=sm] .mgmt-brand-arrow {
    display: none;
}

/* System status: hide entirely */
[data-sidebar-size=sm] .mgmt-system-status {
    display: none;
}

/* Store info box: center pin icon, hide text + arrow */
[data-sidebar-size=sm] .mgmt-store-info-box {
    margin: 4px;
    padding: 8px 4px;
    justify-content: center;
    gap: 0;
    transition: none;
    z-index: 10;
}
[data-sidebar-size=sm] .mgmt-store-info-text,
[data-sidebar-size=sm] .mgmt-store-info-box > .mgmt-brand-arrow {
    display: none;
}
/* Hover expand: show store name (same pattern as Velzon nav-item hover) */
[data-sidebar-size=sm] .mgmt-store-info-box:hover {
    width: calc(200px + var(--vz-vertical-menu-width-sm) - 8px);
    padding: 10px 12px;
    justify-content: flex-start;
    gap: 10px;
    background: #1a2a1a;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.35);
}
[data-sidebar-size=sm] .mgmt-store-info-box:hover .mgmt-store-info-text {
    display: block;
}
[data-sidebar-size=sm] .mgmt-store-info-box:hover > .mgmt-brand-arrow {
    display: block;
}

/* Sidebar foot: center avatar + just logout icon */
[data-sidebar-size=sm] .mgmt-sidebar-foot {
    padding: 10px 4px;
}
[data-sidebar-size=sm] .mgmt-sidebar-user {
    justify-content: center;
    padding: 8px;
    gap: 0;
}
[data-sidebar-size=sm] .mgmt-sidebar-user-text {
    display: none;
}
[data-sidebar-size=sm] .mgmt-sidebar-logout span {
    display: none;
}
[data-sidebar-size=sm] .mgmt-sidebar-logout {
    margin-top: 6px;
    padding: 8px;
}

/* sm mode: hover expand goes over main-content — needs opaque bg */
[data-sidebar-size=sm] .app-menu .navbar-nav .nav-item:hover > .nav-link,
[data-sidebar-size=sm] .app-menu .navbar-nav .nav-item:hover > .menu-link {
    background-color: #1a2a1a !important;
}
/* sm mode: SVG icons need same size as <i> icon fonts (22px) to prevent height jump on hover */
[data-sidebar-size=sm] .app-menu .navbar-nav .nav-link svg,
[data-sidebar-size=sm] .app-menu .navbar-nav .menu-link svg {
    width: 22px;
    height: 22px;
}
.app-menu .navbar-nav .nav-link.active,
.app-menu .navbar-nav .menu-link.active {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
}
.app-menu .navbar-nav .nav-link svg,
.app-menu .navbar-nav .menu-link svg {
    stroke: rgba(255, 255, 255, 0.65) !important;
    fill: none !important;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
.app-menu .navbar-nav .nav-link:hover svg,
.app-menu .navbar-nav .menu-link:hover svg {
    stroke: rgba(255, 255, 255, 0.9) !important;
}
.app-menu .navbar-nav .nav-link.active svg,
.app-menu .navbar-nav .menu-link.active svg {
    stroke: #fff !important;
}
.app-menu .navbar-nav .menu-title > span {
    color: rgba(255, 255, 255, 0.38) !important;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.app-menu .navbar-nav .menu-title::before,
.app-menu .navbar-nav .menu-title::after {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ── Sidebar brand switcher (navbar-brand-box) ───────────────────── */
/* Keep Velzon's 70px height to match header; override background */
.navbar-brand-box {
    height: 70px !important;
    padding: 0 16px !important;
    line-height: normal !important;
    display: flex !important;
    align-items: center !important;
    background-color: #1a2a1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.mgmt-brand-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex: 1;
    min-width: 0;
    cursor: pointer;
    transition: background .15s;
}

.mgmt-brand-current:hover {
    background: rgba(255, 255, 255, 0.07);
}

.mgmt-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #22c55e;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mgmt-brand-info {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.mgmt-brand-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mgmt-brand-sub {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mgmt-brand-arrow {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* ── System status (inside scrollbar, top of menu) ───────────────── */
.mgmt-system-status {
    padding: 10px 12px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mgmt-system-app {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.42);
}

.mgmt-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    flex-shrink: 0;
}

.mgmt-status-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.62);
}

/* ── Sidebar bottom: user card + logout ─────────────────────────── */
/* Velzon's .navbar-menu is position:fixed, so absolute child anchors to it.
   simplebar applies an explicit height to #scrollbar, so flex won't expand it;
   pin the foot to the bottom independently. */
/* 
 * Calculate scrollbar height to prevent items from being hidden behind the absolute footer:
 * 100vh: Full viewport height
 * - 70px: Height of the top brand logo box (.navbar-brand-box)
 * - 135px: Approx total height of the bottom footer (.mgmt-sidebar-foot) including padding & margins
 */
#scrollbar {
    height: calc(100vh - 70px - 135px) !important;
}

.mgmt-sidebar-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 16px 16px;
    background: #1a2a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 5;
}

.mgmt-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.mgmt-sidebar-user-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mgmt-sidebar-user-text {
    min-width: 0;
    line-height: 1.25;
}

.mgmt-sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mgmt-sidebar-user-email {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mgmt-sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: border-color .2s, color .2s, background-color .2s;
}

.mgmt-sidebar-logout:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

/* ── Header: brand logo (bordered box, color via --brand-color) ─────── */
.mgmt-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--brand-color, #22c55e);
    border-radius: 8px;
    padding: 5px 12px 5px 5px;
}

.mgmt-header-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    /* background comes from inline style per brand */
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mgmt-header-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

/* ── Header: search bar (fixed max-width, left-aligned) ─────────────── */
.mgmt-header-search {
    max-width: 420px;
    width: 100%;
}

.mgmt-header-search .form-control {
    padding-left: 36px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    height: 38px;
}

.mgmt-header-search .form-control:focus {
    background: #fff;
    box-shadow: none;
    border-color: #22c55e;
    outline: none;
}

.mgmt-header-search-icon {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}

/* ── Header: notification bell + user info ───────────────────────── */
.mgmt-header-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #64748b;
    font-size: 20px;
}

.mgmt-header-bell-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
}

.mgmt-header-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-right: 6px;
    user-select: none;
    pointer-events: none;
}

.mgmt-header-user-text {
    text-align: right;
    line-height: 1.2;
}

.mgmt-header-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.mgmt-header-user-role {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.mgmt-header-user-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Dashboard page header ───────────────────────────────────────── */
.mgmt-dashboard-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mgmt-dashboard-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.mgmt-dashboard-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.mgmt-last-updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}

/* ── Brand dropdown (fixed, below sidebar brand box) ─────────────── */
.mgmt-brand-dropdown {
    position: fixed;
    top: 70px;
    left: 0;
    width: 250px;
    z-index: 1003;
    background: #1e2e1e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0 0 12px 12px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mgmt-brand-dropdown-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 8px 8px;
}

.mgmt-brand-dropdown-form {
    margin: 0;
    padding: 0;
}

.mgmt-brand-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background .15s;
}

.mgmt-brand-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.mgmt-brand-dropdown-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.mgmt-brand-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mgmt-brand-item-info {
    flex: 1;
    min-width: 0;
    text-align: left;
    line-height: 1.2;
}

.mgmt-brand-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.mgmt-brand-item-sub {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.mgmt-brand-active-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

/* ── Staff header: store context bar ────────────────────────────── */
.mgmt-staff-store-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 8px;
    flex: 1; /* fill full width of navbar-header */
}

.mgmt-staff-store-pin {
    color: #f59e0b;
    font-size: 16px;
    flex-shrink: 0;
}

.mgmt-staff-store-context {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.mgmt-staff-store-label {
    font-size: 10px;
    color: #64748b;
}

.mgmt-staff-store-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.mgmt-staff-store-sep {
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 300;
    flex-shrink: 0;
}

.mgmt-staff-notice {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #f59e0b;
    font-weight: 500;
}

/* Staff header badge (orange) */
.mgmt-header-user-badge--staff {
    background: #f59e0b;
}

@media (max-width: 767.98px) {
    .mgmt-staff-store-sep,
    .mgmt-staff-notice {
        display: none;
    }
}

/* ── Staff sidebar: store info box ──────────────────────────────── */
.mgmt-store-info-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 12px 4px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 10px;
}

/* Store info box becomes a switcher when staff is assigned to multiple stores */
.mgmt-store-info-box--switcher {
    cursor: pointer;
    transition: background .15s;
}

.mgmt-store-info-box--switcher:hover {
    background: rgba(245, 158, 11, 0.18);
}

/* Store dropdown: anchored to the (relative) store info box, not fixed like
   the brand dropdown, since its vertical position varies with layout above it. */
.mgmt-store-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1003;
    background: #1e2e1e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mgmt-store-info-pin {
    font-size: 18px;
    color: #f59e0b;
    flex-shrink: 0;
}

.mgmt-store-info-text {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.mgmt-store-info-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mgmt-store-info-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Staff dashboard icon (orange) ──────────────────────────────── */
.mgmt-dashboard-icon--store {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
