:root {
  --navy-950: #09182b;
  --navy-900: #10243e;
  --navy-800: #183453;
  --navy-700: #285071;
  --ink: #192638;
  --muted: #667386;
  --line: #dfe5eb;
  --line-soft: #edf1f4;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --amber: #f3a712;
  --amber-soft: #fff4d7;
  --green: #16805b;
  --green-soft: #e7f6ef;
  --red: #b84848;
  --red-soft: #fdecec;
  --blue: #2672aa;
  --blue-soft: #e9f3fb;
  --shadow: 0 12px 34px rgba(16, 36, 62, 0.09);
  --radius: 14px;
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 30; display: flex; flex-direction: column; overflow-y: auto; padding: 24px 16px; color: #fff; background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 72%, #163551 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 30px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.35); background: #fff; color: var(--navy-950); font-weight: 900; font-size: 17px; letter-spacing: -.06em; }
.brand strong { display: block; font-size: 15px; letter-spacing: .03em; }
.brand span { display: block; margin-top: 3px; color: #9db2c7; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.nav-list { display: grid; gap: 6px; }
.nav-item { position: relative; width: 100%; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; border: 0; border-radius: 9px; padding: 12px 13px; text-align: left; color: #b7c8d8; background: transparent; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 var(--amber); }
.nav-icon { font-size: 19px; color: #8fa9c0; }
.nav-item.is-active .nav-icon { color: var(--amber); }
.nav-badge { min-width: 22px; padding: 2px 6px; border-radius: 10px; color: var(--navy-950); background: var(--amber); font-size: 11px; font-weight: 800; text-align: center; }
.industry-nav { margin: 1px 0 14px 22px; padding: 10px 0 2px 10px; border-left: 1px solid rgba(255,255,255,.13); }
.industry-nav[hidden] { display: none; }
.industry-nav-title { display: flex; align-items: baseline; justify-content: space-between; padding: 0 10px 9px; }
.industry-nav-title span { color: #d9e4ed; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.industry-nav-title small { color: #6f8aa1; font-size: 7px; letter-spacing: .14em; }
.industry-nav-list { display: grid; gap: 3px; }
.industry-button { width: 100%; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; border: 0; border-radius: 7px; padding: 9px 10px; color: #9fb3c5; background: transparent; text-align: left; font-size: 10px; transition: .15s ease; }
.industry-button::before { content: ""; width: 5px; height: 5px; border: 1px solid #69879f; border-radius: 50%; }
.industry-button span:last-child { min-width: 21px; padding: 2px 6px; border-radius: 9px; color: #91a9bc; background: rgba(255,255,255,.06); font-size: 8px; text-align: center; }
.industry-button:hover { color: #fff; background: rgba(255,255,255,.06); }
.industry-button.is-active { color: #fff; background: rgba(255,255,255,.11); font-weight: 800; }
.industry-button.is-active::before { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 3px rgba(243,167,18,.12); }
.industry-button.is-active span:last-child { color: var(--navy-950); background: var(--amber); }
.sidebar-footer { margin-top: auto; padding: 18px 9px 2px; border-top: 1px solid rgba(255,255,255,.1); }
.test-stamp { display: inline-flex; padding: 5px 8px; border: 1px solid rgba(243,167,18,.45); color: #ffd370; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.sidebar-footer p { margin: 9px 0 0; color: #91a7ba; font-size: 11px; }

.main-column { grid-column: 2; min-width: 0; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #8793a1; font-size: 12px; }
.breadcrumb strong { color: var(--ink); }
.role-control { display: flex; align-items: center; gap: 10px; }
.role-control label { color: var(--muted); font-size: 11px; font-weight: 700; }
.role-select-wrap { display: flex; align-items: center; gap: 8px; min-width: 142px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.role-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--blue); }
.role-select-wrap select { width: 100%; border: 0; outline: 0; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }

main { padding: 0 34px 64px; }
.environment-banner { display: flex; align-items: center; gap: 9px; margin: 18px 0 0; padding: 10px 14px; border: 1px solid #ead99a; border-radius: 8px; background: #fff8e2; color: #725b1b; font-size: 11px; }
.environment-banner strong { color: #5d4811; }
.environment-banner .text-button { margin-left: auto; white-space: nowrap; }
.pulse-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(243,167,18,.16); }
.text-button { border: 0; padding: 2px; color: var(--navy-700); background: none; font-size: 11px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.view { display: none; }
.view.is-visible { display: block; animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 36px 0 25px; }
.eyebrow { margin: 0 0 7px; color: var(--navy-700); font-size: 10px; font-weight: 800; letter-spacing: .19em; }
h1 { margin: 0; color: var(--navy-950); font-family: Georgia, "Yu Mincho", serif; font-size: clamp(27px, 3vw, 38px); font-weight: 600; letter-spacing: .02em; }
.lead { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border-radius: 8px; padding: 10px 17px; font-size: 12px; font-weight: 800; transition: .16s ease; }
.primary-button { border: 1px solid var(--navy-900); color: #fff; background: var(--navy-900); box-shadow: 0 4px 12px rgba(16,36,62,.16); }
.primary-button:hover { background: var(--navy-800); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.secondary-button:hover { border-color: #b9c4ce; background: #f8fafb; }
.danger-button { border-color: var(--red) !important; color: #fff !important; background: var(--red) !important; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.stat-card { position: relative; overflow: hidden; padding: 17px 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.stat-card::after { content: ""; position: absolute; right: -14px; bottom: -24px; width: 72px; height: 72px; border-radius: 50%; background: var(--stat-soft, #f0f4f7); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.stat-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--stat-color, var(--navy-700)); background: var(--stat-soft, #f0f4f7); font-size: 13px; }
.stat-value { display: block; margin-top: 7px; color: var(--navy-950); font-family: Georgia, serif; font-size: 27px; line-height: 1; }
.stat-note { display: block; margin-top: 6px; color: #8894a1; font-size: 9px; }

.order-checker { display: grid; grid-template-columns: auto minmax(210px,1fr) minmax(235px,.7fr) auto; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 17px; border: 1px solid #cbd9e4; border-radius: 11px; background: linear-gradient(135deg,#eef5f9 0%,#fff 72%); }
.order-checker-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #fff; background: var(--navy-800); font-weight: 900; }
.order-checker-copy strong, .order-checker-copy span { display: block; }
.order-checker-copy strong { color: var(--navy-950); font-size: 11px; }
.order-checker-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.order-select { display: grid; gap: 4px; }
.order-select span { color: #758294; font-size: 8px; font-weight: 800; }
.order-select select { width: 100%; height: 38px; border: 1px solid #b9cad7; border-radius: 7px; padding: 0 9px; outline: 0; color: var(--navy-800); background: #fff; font-size: 10px; font-weight: 700; }
.order-result { min-width: 105px; padding-left: 14px; border-left: 1px solid #d4dfe7; text-align: right; }
.order-result strong, .order-result span { display: block; }
.order-result strong { color: var(--navy-950); font-family: Georgia, serif; font-size: 20px; }
.order-result span { margin-top: 2px; color: var(--muted); font-size: 8px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(16,36,62,.03); }
.supplier-panel { overflow: hidden; }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1.8fr) repeat(2, minmax(140px,.7fr)); gap: 9px; padding: 15px; border-bottom: 1px solid var(--line-soft); }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #f9fafb; }
.search-box span { color: #7d8997; font-size: 20px; transform: rotate(-18deg); }
.search-box input { width: 100%; height: 38px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.toolbar select { height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; outline: 0; color: #435064; background: #fff; font-size: 11px; }
.result-meta { display: flex; align-items: baseline; gap: 3px; padding: 14px 17px 7px; color: var(--muted); font-size: 10px; }
.result-meta strong { color: var(--ink); font-size: 12px; }
.table-wrap { overflow-x: auto; padding: 0 10px 10px; }
table { width: 100%; border-collapse: collapse; min-width: 1030px; }
th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: #7c8896; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-align: left; white-space: nowrap; }
td { padding: 13px 9px; border-bottom: 1px solid var(--line-soft); color: #455267; font-size: 11px; vertical-align: middle; }
tbody tr { transition: .15s ease; }
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: 0; }
.company-cell { min-width: 175px; }
.company-cell strong { display: block; color: var(--ink); font-size: 12px; }
.company-cell span { display: block; margin-top: 4px; color: #8a96a4; font-size: 9px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; min-height: 21px; padding: 3px 7px; border-radius: 4px; color: var(--navy-700); background: #edf3f7; font-size: 9px; font-weight: 700; white-space: nowrap; }
.tag.more { color: var(--muted); background: #f3f4f6; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 12px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active, .status-approved { color: var(--green); background: var(--green-soft); }
.status-suspended, .status-rejected { color: var(--red); background: var(--red-soft); }
.status-pending { color: #9a6900; background: var(--amber-soft); }
.compliance-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 4px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.compliance-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.compliance-clear { color: var(--green); background: var(--green-soft); }
.compliance-attention { color: var(--red); background: var(--red-soft); }
.compliance-checking { color: #9a6900; background: var(--amber-soft); }
.compliance-unchecked { color: #778493; background: #edf1f4; }
.mini-checks { display: flex; gap: 5px; }
.mini-check { display: inline-flex; align-items: center; gap: 3px; color: #68778a; font-size: 9px; white-space: nowrap; }
.mini-check.ok { color: var(--green); }
.license-tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 230px; }
.license-badge { display: inline-flex; align-items: center; gap: 3px; min-height: 21px; padding: 3px 6px; border: 1px solid #c8d9e5; border-radius: 4px; color: #285071; background: #eff6fa; font-size: 8px; font-weight: 800; white-space: nowrap; }
.license-badge.staffing { border-color: #d7c8e5; color: #684a86; background: #f7f0fb; }
.license-none { color: #8b96a3; font-size: 9px; }
.detail-button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 7px; color: var(--navy-700); background: #fff; }
.detail-button:hover { border-color: #aebbc7; background: #f5f8fa; }
.mobile-cards { display: none; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state div { font-size: 33px; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-top: 8px; color: var(--ink); }
.empty-state span { margin-top: 5px; font-size: 11px; }

.application-history-control { display: flex; justify-content: flex-end; margin-bottom: 15px; }
.application-history-control label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; color: #475569; background: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.application-history-control input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.summary-card { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.summary-number { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--navy-900); background: #f0f4f7; font-family: Georgia, serif; font-size: 21px; }
.summary-card.pending .summary-number { color: #9a6900; background: var(--amber-soft); }
.summary-card.approved .summary-number { color: var(--green); background: var(--green-soft); }
.summary-card div:last-child strong, .summary-card div:last-child span { display: block; }
.summary-card div:last-child strong { font-size: 11px; }
.summary-card div:last-child span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.application-list { display: grid; gap: 11px; }
.application-card { display: grid; grid-template-columns: minmax(210px,1.5fr) repeat(3,minmax(105px,.6fr)) auto; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.application-company strong { display: block; color: var(--ink); font-size: 13px; }
.application-company span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.application-meta span, .application-meta strong { display: block; }
.application-meta span { color: #8995a2; font-size: 8px; font-weight: 800; letter-spacing: .05em; }
.application-meta strong { margin-top: 4px; color: #465468; font-size: 10px; }
.application-actions { display: flex; gap: 7px; }
.application-comparison { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.application-comparison-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.application-comparison-title strong { color: #334155; font-size: 10px; }
.application-comparison-title span { padding: 3px 7px; border-radius: 999px; color: #1d4ed8; background: #dbeafe; font-size: 8px; font-weight: 800; }
.application-comparison.is-empty p, .comparison-caution { margin: 0; color: #64748b; font-size: 9px; line-height: 1.6; }
.comparison-caution { margin: -2px 0 9px; color: #92400e; }
.change-comparison-head { display: grid; grid-template-columns: minmax(100px,.55fr) minmax(180px,1fr) minmax(180px,1fr); gap: 26px; padding: 0 10px 6px; color: #94a3b8; font-size: 8px; font-weight: 800; }
.change-comparison-list { display: grid; gap: 7px; }
.change-comparison-row { display: grid; grid-template-columns: minmax(100px,.55fr) minmax(180px,1fr) 20px minmax(180px,1fr); align-items: stretch; gap: 8px; padding: 9px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f8fafc; }
.change-comparison-row > strong { align-self: center; color: #475569; font-size: 9px; }
.change-value { min-width: 0; padding: 8px 9px; border-radius: 7px; }
.change-value.before { color: #64748b; background: #fff; }
.change-value.after { color: #166534; background: #f0fdf4; }
.change-value small { display: none; margin-bottom: 4px; color: #94a3b8; font-size: 7px; font-weight: 800; }
.change-value span { display: block; overflow-wrap: anywhere; font-size: 9px; font-weight: 700; line-height: 1.55; white-space: pre-line; }
.change-arrow { align-self: center; color: #94a3b8; font-size: 12px; text-align: center; }
.small-button { min-width: 58px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--navy-800); background: #fff; font-size: 9px; font-weight: 800; }
.small-button.approve { border-color: #b9dccd; color: var(--green); background: var(--green-soft); }
.small-button.reject { border-color: #edc7c7; color: var(--red); background: var(--red-soft); }
.application-empty { padding: 65px 20px; border: 1px dashed #cbd4dd; border-radius: 12px; color: var(--muted); text-align: center; }
.application-empty strong { display: block; margin-bottom: 6px; color: var(--ink); }

.workflow-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 15px; }
.workflow-panel, .permission-panel { padding: 24px; }
.workflow-panel h2, .permission-panel h2 { margin: 0 0 21px; color: var(--navy-950); font-family: Georgia, serif; font-size: 18px; font-weight: 600; }
.flow-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.flow-step > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #fff; background: var(--navy-900); font-size: 11px; font-weight: 800; }
.flow-step strong { font-size: 12px; }
.flow-step p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.flow-line { width: 1px; height: 25px; margin: 5px 0 5px 15px; background: #c9d3dc; }
.permission-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.permission-row { display: grid; grid-template-columns: 2fr repeat(3,.55fr); }
.permission-row span { display: grid; place-items: center; min-height: 38px; padding: 7px; border-bottom: 1px solid var(--line-soft); color: #59677a; font-size: 9px; text-align: center; }
.permission-row span:first-child { justify-items: start; text-align: left; }
.permission-row:last-child span { border-bottom: 0; }
.permission-head { background: #f5f7f9; }
.permission-head span { color: #778493; font-weight: 800; }
.permission-yes { color: var(--green) !important; font-weight: 900; }
.current-role-card { margin-top: 16px; padding: 13px 14px; border-left: 3px solid var(--blue); border-radius: 4px 8px 8px 4px; background: var(--blue-soft); color: #244e70; font-size: 10px; line-height: 1.6; }
.current-role-card strong { display: block; margin-bottom: 2px; color: #173d5c; font-size: 11px; }
.future-panel { display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; margin-top: 15px; padding: 20px 22px; background: linear-gradient(135deg,#fff 0%,#f7fafc 100%); }
.future-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; color: var(--amber); background: var(--navy-900); font-size: 19px; }
.future-panel strong { color: var(--navy-950); font-size: 12px; }
.future-panel p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.future-tags { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.future-tags span:nth-child(odd) { padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--navy-700); background: #fff; font-weight: 800; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(9,24,43,.38); opacity: 0; transition: opacity .2s; }
.drawer-backdrop.is-visible { opacity: 1; }
.detail-drawer { position: fixed; inset: 0 0 0 auto; z-index: 60; width: min(520px, 94vw); overflow-y: auto; padding: 0 26px 32px; background: #fff; box-shadow: -18px 0 45px rgba(9,24,43,.18); transform: translateX(103%); transition: transform .24s ease; }
.detail-drawer.is-open { transform: none; }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px 0 15px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-edit-button { min-height: 31px; margin-left: auto; margin-right: 8px; padding: 5px 10px; color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; font-size: 10px; }
.drawer-label { color: var(--navy-700); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: #566477; background: #fff; font-size: 19px; line-height: 1; }
.detail-hero { padding: 25px 0 20px; }
.detail-hero h2 { margin: 9px 0 5px; color: var(--navy-950); font-family: Georgia, "Yu Mincho", serif; font-size: 25px; font-weight: 600; }
.detail-hero p { margin: 0; color: var(--muted); font-size: 10px; }
.detail-section { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.detail-section h3 { margin: 0 0 13px; color: #788596; font-size: 9px; letter-spacing: .12em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.detail-item span, .detail-item strong { display: block; }
.detail-item span { color: #8b97a4; font-size: 8px; font-weight: 800; }
.detail-item strong { margin-top: 5px; color: #334256; font-size: 11px; line-height: 1.5; }
.contact-card { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.contact-list { display: grid; gap: 9px; }
.contact-empty { margin: 0; color: var(--muted); font-size: 10px; }
.contact-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--navy-700); font-size: 11px; font-weight: 800; }
.contact-card strong { display: block; font-size: 11px; }
.contact-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.license-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.license-matrix-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.license-matrix-item span { color: #677588; font-size: 9px; }
.license-matrix-item strong { color: var(--navy-800); font-size: 10px; }
.license-matrix-item strong.none { color: #9aa4af; font-weight: 500; }
.license-matrix-item { align-items: flex-start; }
.license-matrix-copy { text-align: right; }
.license-matrix-copy strong, .license-matrix-copy small { display: block; }
.license-matrix-copy small { margin-top: 4px; color: #82909f; font-size: 8px; line-height: 1.4; }
.compliance-panel { padding: 14px; border: 1px solid #ccd9e3; border-radius: 10px; background: linear-gradient(145deg,#f1f7fa,#fff); }
.compliance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.compliance-head strong, .compliance-head span { display: block; }
.compliance-head strong { color: var(--navy-950); font-size: 11px; }
.compliance-head span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.compliance-checks { display: grid; gap: 7px; margin-top: 12px; }
.compliance-check { display: grid; grid-template-columns: 17px 1fr auto; gap: 7px; align-items: center; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(255,255,255,.8); }
.compliance-check > span:first-child { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #fff; background: #8b98a6; font-size: 9px; }
.compliance-check.is-clear > span:first-child { background: var(--green); }
.compliance-check.is-attention > span:first-child { background: var(--red); }
.compliance-check strong { color: #445267; font-size: 9px; }
.compliance-check small { color: #8a96a4; font-size: 8px; }
.ai-check-button { border: 1px solid var(--navy-800); border-radius: 7px; padding: 8px 10px; color: #fff; background: var(--navy-800); font-size: 8px; font-weight: 800; white-space: nowrap; }
.ai-check-note { margin: 9px 0 0; color: #7d8996; font-size: 8px; line-height: 1.5; }
.audit-list { display: grid; gap: 9px; }
.audit-item { position: relative; padding-left: 16px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.audit-item::before { content: ""; position: absolute; left: 0; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.audit-item strong { color: #405065; }

dialog { max-height: calc(100vh - 36px); border: 0; padding: 0; color: var(--ink); box-shadow: 0 28px 80px rgba(9,24,43,.24); }
dialog::backdrop { background: rgba(9,24,43,.52); backdrop-filter: blur(2px); }
.form-dialog { width: min(820px, calc(100vw - 28px)); border-radius: 15px; }
.form-dialog form { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: calc(100vh - 36px); }
.dialog-header { display: flex; justify-content: space-between; gap: 20px; padding: 22px 25px 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; color: var(--navy-950); font-family: Georgia, "Yu Mincho", serif; font-size: 23px; font-weight: 600; }
.dialog-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.dialog-body { overflow-y: auto; padding: 20px 25px; }
.role-notice { margin-bottom: 20px; padding: 11px 13px; border-radius: 7px; color: #355d78; background: var(--blue-soft); font-size: 10px; line-height: 1.55; }
.role-notice.super { color: #6e5310; background: var(--amber-soft); }
.form-section { padding: 0 0 24px; }
.form-section + .form-section { padding-top: 22px; border-top: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.section-heading > span { color: var(--amber); font-family: Georgia, serif; font-size: 17px; }
.section-heading strong, .section-heading small { display: block; }
.section-heading strong { color: var(--navy-950); font-size: 12px; }
.section-heading small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field.span-2 { grid-column: 1 / -1; }
.field > span, .field legend { color: #5b6879; font-size: 9px; font-weight: 800; }
.field b, fieldset b { color: var(--red); font-size: 8px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; outline: none; color: var(--ink); background: #fff; font-size: 11px; transition: .15s ease; }
.field input, .field select { height: 40px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(40,80,113,.1); }
fieldset.field { margin: 0 0 15px; border: 0; padding: 0; }
fieldset.field legend { margin-bottom: 8px; padding: 0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.check-option { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: #526073; background: #fff; font-size: 9px; cursor: pointer; }
.check-option:has(input:checked) { border-color: #91adbf; color: var(--navy-800); background: #f2f7fa; font-weight: 800; }
.check-option input { width: 14px; height: 14px; flex: 0 0 auto; accent-color: var(--navy-800); }
.region-field { margin-bottom: 14px !important; }
.region-checkbox-grid { grid-template-columns: repeat(5,1fr); }
.region-list { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.region-badge { display: inline-flex; padding: 3px 7px; border: 1px solid #bfdbfe; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 8px; font-weight: 800; white-space: nowrap; }
.invoice-toggle { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; cursor: pointer; }
.invoice-toggle:has(input:checked) { border-color: #86efac; background: #f0fdf4; }
.invoice-toggle input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #047857; }
.invoice-toggle strong, .invoice-toggle small { display: block; }
.invoice-toggle strong { color: #445267; font-size: 10px; }
.invoice-toggle small { margin-top: 3px; color: #8b97a4; font-size: 8px; }
.contact-editor-list { display: grid; gap: 11px; }
.contact-editor-row { position: relative; margin: 0; padding: 16px 14px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; }
.contact-editor-row legend { padding: 0 6px; color: var(--navy-800); font-size: 9px; font-weight: 800; }
.contact-remove-button { display: block; margin: 10px 0 0 auto; border: 0; padding: 3px 0; color: var(--red); background: transparent; font-size: 8px; font-weight: 700; }
.add-contact-button { min-height: 35px; margin-top: 10px; padding: 7px 11px; font-size: 9px; }
.contact-notes { margin-top: 15px; }
.detail-category-list { margin-bottom: 15px; }
.license-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.license-field { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.license-field > span { color: #526173; font-size: 9px; font-weight: 800; }
.license-field select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; outline: 0; color: var(--ink); background: #fff; font-size: 10px; }
.license-toggle { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.license-toggle:has(input:checked) { border-color: #91adbf; background: #f1f7fa; }
.license-toggle input { width: 17px; height: 17px; accent-color: var(--navy-800); }
.license-toggle strong, .license-toggle small { display: block; }
.license-toggle strong { color: #405064; font-size: 10px; }
.license-toggle small { margin-top: 3px; color: #84909e; font-size: 8px; line-height: 1.4; }
.license-entry { display: grid; gap: 9px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; }
.license-entry > strong { color: #405064; font-size: 10px; }
.license-entry .license-toggle { min-height: 48px; padding: 0; border: 0; background: transparent; }
.license-entry .license-toggle:has(input:checked) { background: transparent; }
.license-entry-fields { display: grid; grid-template-columns: .75fr 1.55fr 1fr; gap: 7px; }
.license-entry-fields.compact { grid-template-columns: 1.35fr 1fr; }
.license-entry-fields.simple { grid-template-columns: minmax(180px, 240px); }
.license-entry-fields label { display: grid; gap: 4px; }
.license-entry-fields label span { color: #7d8997; font-size: 8px; font-weight: 700; }
.license-entry-fields input, .license-entry-fields select { min-width: 0; width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; outline: 0; color: var(--ink); background: #fff; font-size: 9px; }
.license-verification { margin-top: 12px; }
.license-caution { margin: 10px 0 0; padding-left: 11px; border-left: 2px solid var(--amber); color: #7e6a37; font-size: 8px; line-height: 1.6; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 25px; border-top: 1px solid var(--line); background: #fafbfd; }
.decision-dialog { width: min(430px, calc(100vw - 28px)); border-radius: 14px; }
.decision-dialog form { padding: 26px; text-align: center; }
.decision-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 21px; font-weight: 900; }
.decision-icon.reject { color: var(--red); background: var(--red-soft); }
.decision-dialog h2 { margin: 0; color: var(--navy-950); font-family: Georgia, "Yu Mincho", serif; font-size: 20px; }
.decision-dialog p { margin: 8px 0 19px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.decision-dialog .field { text-align: left; }
.decision-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; padding: 13px 15px; border-left: 4px solid var(--green); border-radius: 8px; color: #fff; background: var(--navy-950); box-shadow: var(--shadow); font-size: 11px; animation: toastIn .2s ease; }
.toast.error { border-left-color: var(--red); }
.toast strong { display: block; margin-bottom: 2px; }
.toast span { color: #b8c7d5; font-size: 9px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .toolbar { grid-template-columns: 1.6fr repeat(2,1fr); }
  .workflow-grid { grid-template-columns: 1fr; }
  .application-card { grid-template-columns: minmax(210px,1.4fr) repeat(2,minmax(100px,.6fr)) auto; }
  .application-card .application-meta:nth-of-type(4) { display: none; }
  .order-checker { grid-template-columns: auto 1fr minmax(220px,.8fr); }
  .order-result { grid-column: 2 / -1; border-left: 0; padding-left: 0; text-align: left; }
  .order-result strong, .order-result span { display: inline; }
  .order-result span { margin-left: 4px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-103%); transition: transform .22s ease; box-shadow: 14px 0 40px rgba(9,24,43,.25); }
  .sidebar.is-open { transform: none; }
  .main-column { min-width: 0; }
  .mobile-menu { display: block; }
  .topbar { height: 64px; padding: 0 18px; }
  .breadcrumb { display: none; }
  .role-control label { display: none; }
  main { padding: 0 17px 45px; }
  .environment-banner { align-items: flex-start; flex-wrap: wrap; line-height: 1.45; }
  .environment-banner .text-button { margin-left: 17px; }
  .page-heading { align-items: flex-start; padding: 28px 0 20px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .toolbar select:last-child { grid-column: auto; }
  .table-wrap { display: none; }
  .mobile-cards { display: grid; gap: 9px; padding: 6px 12px 14px; }
  .supplier-card { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .supplier-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .supplier-card h3 { margin: 0; font-size: 12px; }
  .supplier-card p { margin: 5px 0 10px; color: var(--muted); font-size: 9px; }
  .supplier-card-meta { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); color: #69778a; font-size: 9px; }
  .application-card { grid-template-columns: 1fr auto; }
  .application-meta { display: none; }
  .change-comparison-head { display: none; }
  .change-comparison-row { grid-template-columns: 1fr 20px 1fr; }
  .change-comparison-row > strong { grid-column: 1 / -1; }
  .change-value small { display: block; }
  .future-panel { grid-template-columns: auto 1fr; }
  .future-tags { grid-column: 1 / -1; justify-content: center; }
  .order-checker { grid-template-columns: auto 1fr; }
  .order-select, .order-result { grid-column: 1 / -1; }
  .order-result { border-top: 1px solid #d4dfe7; padding-top: 9px; }
}

@media (max-width: 560px) {
  .role-select-wrap { min-width: 126px; }
  .environment-banner span:nth-child(3) { width: calc(100% - 18px); }
  .page-heading { display: grid; }
  .page-heading .primary-button { width: 100%; }
  h1 { font-size: 28px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 23px; }
  .toolbar { grid-template-columns: 1fr; }
  .search-box, .toolbar select:last-child { grid-column: auto; }
  .application-card { align-items: start; }
  .application-actions { flex-direction: column; }
  .change-comparison-row { grid-template-columns: 1fr; }
  .change-arrow { transform: rotate(90deg); }
  .permission-row { grid-template-columns: 1.7fr repeat(3,.55fr); }
  .workflow-panel, .permission-panel { padding: 18px; }
  .future-tags { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2, .form-span-2 { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
  .license-form-grid, .license-matrix { grid-template-columns: 1fr; }
  .license-entry-fields, .license-entry-fields.compact { grid-template-columns: 1fr; }
  .dialog-header, .dialog-body, .dialog-footer { padding-left: 17px; padding-right: 17px; }
  .detail-grid { grid-template-columns: 1fr; }
  .toast-region { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; }
}

/* 見積アプリ（10X RFQ）と共通のUIトーン */
:root {
  --navy-950: #1e293b;
  --navy-900: #2563eb;
  --navy-800: #1d4ed8;
  --navy-700: #2563eb;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --canvas: #f8fafc;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, .10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
}

body { background: #f8fafc; color: #1e293b; }
.app-shell { display: block; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 56px auto 0 0; width: 224px; z-index: 30;
  padding: 12px; color: #475569; background: #fff;
  border-right: 1px solid #e5e7eb; overflow-y: auto;
}
.brand {
  position: fixed; top: 0; left: 0; z-index: 50; width: 224px; height: 56px;
  display: flex; align-items: center; padding: 0 16px; background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.brand strong { color: #1d4ed8; font-size: 18px; font-weight: 650; letter-spacing: .04em; }
.brand span { margin-top: 1px; color: #94a3b8; font-size: 10px; letter-spacing: .04em; text-transform: none; }
.nav-list { gap: 4px; }
.nav-item {
  grid-template-columns: 22px 1fr auto; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: #475569; font-size: 14px; font-weight: 500;
}
.nav-item:hover { color: #0f172a; background: #f8fafc; }
.nav-item.is-active { color: #1d4ed8; background: #eff6ff; box-shadow: none; }
.nav-icon, .nav-item.is-active .nav-icon { color: currentColor; font-size: 17px; }
.nav-badge { min-width: 21px; color: #fff; background: #ef4444; }
.industry-nav { margin: 0 0 10px 16px; padding: 7px 0 4px 11px; border-left: 1px solid #dbe3ee; }
.industry-nav-title { padding: 0 8px 6px; }
.industry-nav-title span { color: #64748b; font-size: 10px; }
.industry-nav-title small { color: #cbd5e1; }
.industry-button { grid-template-columns: 6px 1fr auto; padding: 7px 8px; color: #64748b; font-size: 11px; }
.industry-button::before { width: 4px; height: 4px; border-color: #94a3b8; }
.industry-button:hover { color: #1e293b; background: #f8fafc; }
.industry-button.is-active { color: #1d4ed8; background: #eff6ff; }
.industry-button.is-active::before { border-color: #2563eb; background: #2563eb; box-shadow: none; }
.industry-button span:last-child, .industry-button.is-active span:last-child { color: #64748b; background: #f1f5f9; }
.sidebar-footer { border-top-color: #e5e7eb; }
.test-stamp { border-color: #fbbf24; color: #92400e; background: #fffbeb; }
.sidebar-footer p { color: #94a3b8; }

.main-column { margin-left: 224px; min-width: 0; }
.topbar {
  position: fixed; top: 0; left: 224px; right: 0; z-index: 40; height: 56px;
  padding: 0 16px; border-bottom: 1px solid #e5e7eb; background: #fff; backdrop-filter: none;
}
.breadcrumb strong { color: #64748b; font-size: 13px; font-weight: 500; }
.role-control label { color: #64748b; font-size: 12px; }
.role-select-wrap { min-width: 136px; padding: 5px 9px; border-color: #d1d5db; }
.role-select-wrap select { color: #475569; font-size: 12px; }

main { padding: 74px 24px 64px; }
.environment-banner { margin: 0 0 20px; border-color: #fde68a; background: #fffbeb; color: #92400e; }
.environment-banner strong { color: #92400e; }
.text-button { color: #2563eb; }
.page-heading { align-items: center; padding: 0 0 20px; }
.eyebrow { display: none; }
h1 { color: #1f2937; font-family: inherit; font-size: 20px; font-weight: 600; letter-spacing: 0; }
.lead { margin-top: 5px; color: #64748b; font-size: 12px; }
.primary-button, .secondary-button { min-height: 38px; border-radius: 8px; padding: 8px 14px; font-size: 13px; }
.primary-button { border-color: #2563eb; background: #2563eb; box-shadow: none; }
.primary-button:hover { background: #1d4ed8; transform: none; }
.secondary-button { border-color: #d1d5db; color: #475569; }
.panel, .summary-card, .application-card { border-color: #e5e7eb; border-radius: 12px; box-shadow: none; }
.supplier-panel { overflow: hidden; }
.toolbar { background: #fff; }
.search-box, .toolbar select { border-color: #d1d5db; border-radius: 8px; background: #fff; }
.search-box:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.16); }
table { font-size: 13px; }
th { background: #f9fafb; color: #6b7280; font-size: 11px; font-weight: 500; }
td { color: #475569; }
.company-cell strong { color: #1f2937; font-size: 13px; }
.table-primary, .table-secondary { display: block; }
.table-primary { color: #374151; font-size: 12px; }
.table-secondary { margin-top: 3px; color: #94a3b8; font-size: 10px; }
.tag, .license-badge { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.status-pill { border-radius: 999px; }
.status-estimate { color: #1d4ed8; background: #dbeafe; }
.stat-card { border-color: #e5e7eb; box-shadow: none; }
.order-checker { border-color: #bfdbfe; background: #eff6ff; }
.order-checker-icon, .future-icon { background: #2563eb; }
.order-checker { grid-template-columns: auto minmax(190px,.65fr) minmax(420px,1.6fr) auto; }
.license-filter-group { margin: 0; border: 0; padding: 0; min-width: 0; }
.license-filter-group legend { margin-bottom: 6px; color: #64748b; font-size: 10px; font-weight: 700; }
.license-filter-options { display: flex; flex-wrap: wrap; gap: 6px; }
.license-filter-options label { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 8px; border: 1px solid #bfdbfe; border-radius: 7px; color: #475569; background: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.license-filter-options label:has(input:checked) { border-color: #60a5fa; color: #1d4ed8; background: #dbeafe; }
.license-filter-options input { width: 14px; height: 14px; margin: 0; accent-color: #2563eb; }
.dialog-header h2, .decision-dialog h2, .detail-hero h2, .workflow-panel h2, .permission-panel h2 { font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.check-option input, .license-toggle input { accent-color: #2563eb; }

.integration-note {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  margin-bottom: 16px; padding: 14px 16px; border: 1px solid #bfdbfe;
  border-radius: 12px; background: #eff6ff; color: #1e40af;
}
.partner-update-feed {
  margin: -4px 0 16px;
  padding: 12px 16px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
}
.partner-update-feed[hidden] { display: none; }
.partner-update-feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.partner-update-feed-heading strong { color: #334155; font-size: 12px; }
.partner-update-feed-heading span { color: #94a3b8; font-size: 10px; }
.partner-update-feed ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.partner-update-item {
  display: grid;
  grid-template-columns: 82px 8px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 26px;
  color: #475569;
  font-size: 12px;
}
.partner-update-item time { color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.partner-update-item p { margin: 0; line-height: 1.5; }
.partner-update-item p strong { color: #1f2937; font-weight: 650; }
.partner-update-mark { width: 7px; height: 7px; border-radius: 999px; background: #3b82f6; }
.partner-update-item.is-added .partner-update-mark { background: #10b981; }
.partner-update-item.is-removed { color: #64748b; }
.partner-update-item.is-removed .partner-update-mark { background: #94a3b8; }

@media (max-width: 640px) {
  .partner-update-feed { padding: 12px; }
  .partner-update-item { grid-template-columns: 76px 7px minmax(0, 1fr); gap: 7px; font-size: 11px; }
}
.integration-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; background: #2563eb; font-weight: 800; }
.integration-note strong, .integration-note span { display: block; }
.integration-note strong { font-size: 13px; }
.integration-note div > span { margin-top: 3px; color: #64748b; font-size: 11px; }
.integration-tags { display: flex; align-items: center; gap: 6px; }
.integration-tags span { margin: 0 !important; padding: 5px 8px; border-radius: 999px; color: #1d4ed8 !important; background: #fff; font-size: 10px !important; white-space: nowrap; }
.integration-tags span:nth-child(2) { padding: 0; color: #94a3b8 !important; background: transparent; }
.customer-toolbar { grid-template-columns: minmax(260px, 1fr) 200px; }
.category-tabs {
  display: flex; align-items: center; gap: 4px; overflow-x: auto;
  margin-bottom: 16px; padding: 5px; border: 1px solid #e5e7eb;
  border-radius: 10px; background: #fff; scrollbar-width: thin;
}
.category-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: max-content; min-height: 38px; padding: 8px 14px; border: 0;
  border-radius: 7px; color: #64748b; background: transparent;
  font-size: 12px; font-weight: 600; transition: background .15s ease, color .15s ease;
}
.category-tab:hover { color: #1e293b; background: #f8fafc; }
.category-tab.is-active { color: #1d4ed8; background: #eff6ff; }
.category-tab small {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 999px; color: #64748b; background: #f1f5f9;
  font-size: 10px; font-weight: 700;
}
.category-tab.is-active small { color: #1d4ed8; background: #dbeafe; }
.contract-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.contract-pill.is-complete { color: #047857; background: #d1fae5; }
.contract-pill.is-pending { color: #b45309; background: #fef3c7; }
.contract-pill.is-na { color: #64748b; background: #f1f5f9; }
.contract-folder-cell { display: flex; align-items: center; gap: 7px; min-width: 105px; }
.contract-folder-link { display: inline-flex; align-items: center; gap: 4px; color: #2563eb; font-size: 10px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.contract-folder-link:hover { text-decoration: underline; }
.contract-folder-empty, .contract-folder-warning { color: #94a3b8; font-size: 10px; font-weight: 700; white-space: nowrap; }
.contract-folder-warning { color: #b45309; }
.contract-folder-mobile { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; }
.contract-folder-detail .contract-folder-link { font-size: 12px; }
.field-hint { display: block; margin-top: 5px; color: #64748b; font-size: 9px; line-height: 1.5; }
.direct-status-control { display: flex; align-items: center; justify-content: flex-end; gap: 12px; width: max-content; max-width: 100%; margin: -8px 0 18px auto; padding: 8px 9px 8px 12px; border: 1px solid #dbe3ec; border-radius: 10px; background: #f8fafc; }
.direct-status-control > div:first-child strong, .direct-status-control > div:first-child small { display: block; }
.direct-status-control > div:first-child strong { color: #334155; font-size: 10px; }
.direct-status-control > div:first-child small { margin-top: 2px; color: #94a3b8; font-size: 8px; white-space: nowrap; }
.status-tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 8px; background: #e2e8f0; }
.status-tabs button { min-height: 30px; border: 0; border-radius: 6px; padding: 5px 10px; color: #64748b; background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-tabs button.is-active[data-partner-status="active"] { color: #047857; background: #d1fae5; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.status-tabs button.is-active[data-partner-status="suspended"] { color: #b91c1c; background: #fee2e2; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.contract-folder-restricted { color: #64748b; font-size: 9px; font-weight: 700; white-space: nowrap; }
.service-detail-list { margin: 0; padding-left: 18px; color: #334155; }
.service-detail-list li { margin: 0 0 5px; line-height: 1.55; }
.service-detail-list li:last-child { margin-bottom: 0; }
.smart-entry-panel { margin-bottom: 22px; padding: 15px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; }
.smart-entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.smart-entry-heading strong, .smart-entry-heading span { display: block; }
.smart-entry-heading strong { color: #1e3a8a; font-size: 12px; }
.smart-entry-heading div > span { margin-top: 4px; color: #64748b; font-size: 9px; line-height: 1.5; }
.test-chip { padding: 3px 6px; border-radius: 999px; color: #1d4ed8; background: #dbeafe; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.smart-entry-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.smart-entry-grid .field input { background: #fff; }
.smart-entry-grid input[type="file"] { padding: 8px; font-size: 9px; }
.smart-entry-button { height: 40px; white-space: nowrap; }
.smart-entry-button:disabled { cursor: wait; opacity: .65; }
.smart-entry-status { margin: 9px 0 0; color: #475569; font-size: 9px; line-height: 1.55; }
.smart-entry-status.is-working { color: #1d4ed8; font-weight: 700; }
.smart-entry-status.is-error { color: #b91c1c; font-weight: 700; }
.restricted-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.restricted-heading h3 { margin-bottom: 13px; }
.restricted-heading > span { padding: 3px 7px; border-radius: 999px; color: #7c3aed; background: #ede9fe; font-size: 8px; font-weight: 800; }
.credit-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; padding: 13px; border: 1px solid #ddd6fe; border-radius: 10px; background: #faf5ff; }
.credit-summary, .credit-folder { min-width: 0; }
.credit-summary > span, .credit-summary > strong, .credit-summary > small, .credit-folder > span, .credit-folder > strong { display: block; }
.credit-summary > span, .credit-folder > span { color: #7c3aed; font-size: 8px; font-weight: 800; }
.credit-summary > strong, .credit-folder > strong { margin-top: 5px; color: #3f3f46; font-size: 11px; }
.credit-summary > small { margin-top: 4px; color: #71717a; font-size: 8px; }
.credit-folder-button, .credit-folder-link, .credit-folder-ready { margin-top: 8px; }
.credit-folder-button { min-height: 32px; padding: 6px 9px; font-size: 9px; }
.credit-folder-link { display: inline-flex; color: #6d28d9; font-size: 9px; font-weight: 800; }
.credit-folder-ready { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #047857; background: #d1fae5; font-size: 8px; font-weight: 800; }
.credit-note { margin: 8px 0 0; color: #71717a; font-size: 8px; line-height: 1.55; }
.partner-type { display: inline-flex !important; margin: 0 7px 0 0 !important; padding: 3px 6px; border-radius: 999px; font-size: 9px !important; vertical-align: middle; }
.partner-type.customer { color: #1d4ed8 !important; background: #dbeafe; }
.partner-type.supplier { color: #047857 !important; background: #d1fae5; }

@media (max-width: 1100px) {
  .order-checker { grid-template-columns: auto 1fr; }
  .license-filter-group, .order-result { grid-column: 1 / -1; }
  .order-result { border-top: 1px solid #d4dfe7; border-left: 0; padding: 9px 0 0; text-align: left; }
  .order-result strong, .order-result span { display: inline; }
  .order-result span { margin-left: 4px; }
}

@media (max-width: 820px) {
  .sidebar { inset: 56px auto 0 0; background: #fff; box-shadow: 14px 0 40px rgba(15,23,42,.16); }
  .brand { position: fixed; width: auto; right: auto; }
  .main-column { margin-left: 0; }
  .topbar { left: 0; padding-left: 170px; }
  main { padding: 74px 17px 45px; }
  .integration-note { grid-template-columns: auto 1fr; }
  .integration-tags { grid-column: 1 / -1; }
  .smart-entry-grid { grid-template-columns: 1fr 1fr; }
  .region-checkbox-grid { grid-template-columns: repeat(3,1fr); }
  .smart-entry-button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .brand { width: 154px; }
  .brand strong { font-size: 15px; }
  .brand span { font-size: 9px; }
  .topbar { padding-left: 160px; }
  .mobile-menu { position: fixed; top: 15px; left: 126px; z-index: 60; display: block; }
  .integration-note { grid-template-columns: 1fr; }
  .integration-icon { display: none; }
  .customer-toolbar { grid-template-columns: 1fr; }
  .smart-entry-grid, .credit-panel { grid-template-columns: 1fr; }
  .region-checkbox-grid { grid-template-columns: repeat(2,1fr); }
  .direct-status-control { align-items: stretch; width: 100%; flex-direction: column; }
  .status-tabs { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Supabase実データ検証版 */
[hidden] { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #dbeafe 0, transparent 38%), #f8fafc; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; box-shadow: 0 22px 55px rgba(15, 23, 42, .12); }
.login-brand { margin-bottom: 30px; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { color: #1d4ed8; font-size: 20px; letter-spacing: .04em; }
.login-brand span { margin-top: 3px; color: #94a3b8; font-size: 11px; }
.login-card h1 { font-size: 23px; }
.login-card > p { margin: 8px 0 22px; color: #64748b; font-size: 12px; }
.login-card form { display: grid; gap: 15px; }
.login-card label span { display: block; margin-bottom: 6px; color: #475569; font-size: 11px; font-weight: 700; }
.login-card input { width: 100%; height: 44px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 0 12px; outline: none; font-size: 14px; }
.login-card input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.login-card .primary-button { width: 100%; margin-top: 2px; }
.login-card > small { display: block; margin-top: 18px; color: #94a3b8; font-size: 10px; text-align: center; }
.login-error { min-height: 18px; margin: -4px 0 0; color: #dc2626; font-size: 11px; }
.fatal-error { max-width: 640px; margin: 80px auto; padding: 30px; }
.test-stamp.live { border-color: #86efac; color: #166534; background: #f0fdf4; }
.topbar { justify-content: flex-start; gap: 18px; }
.role-control { margin-left: auto; }
.user-control { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-control span { max-width: 240px; overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-control button { border: 0; padding: 6px 8px; color: #64748b; background: transparent; font-size: 10px; font-weight: 700; }
.user-control button:hover { color: #1d4ed8; }
.environment-banner[data-status="ready"] { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
.environment-banner[data-status="ready"] strong { color: #166534; }
.environment-banner[data-status="error"] { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.environment-banner[data-status="error"] strong { color: #991b1b; }
.status-pill.active { color: #047857; background: #d1fae5; }
.status-pill.suspended { color: #b91c1c; background: #fee2e2; }
.status-pill.estimate { color: #1d4ed8; background: #dbeafe; }
.status-pill.attention, .status-pill.pending { color: #a16207; background: #fef3c7; }
.status-pill.approved { color: #047857; background: #d1fae5; }
.status-pill.rejected { color: #b91c1c; background: #fee2e2; }
.check-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.check-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.check-pill.clear { color: #047857; background: #d1fae5; }
.check-pill.attention { color: #b91c1c; background: #fee2e2; }
.check-pill.unchecked { color: #64748b; background: #f1f5f9; }
.contract-pill.signed { color: #047857; background: #d1fae5; }
.contract-pill.unsigned { color: #b45309; background: #fef3c7; }
.contract-pill.exempt { color: #64748b; background: #f1f5f9; }
.license-badge.purple { border-color: #ddd6fe; color: #6d28d9; background: #f5f3ff; }
.muted-text { color: #94a3b8; font-size: 9px; }
.category-tab > span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; color: #64748b; background: #f1f5f9; font-size: 10px; font-weight: 700; }
.category-tab.is-active > span { color: #1d4ed8; background: #dbeafe; }
.row-arrow { width: 29px; height: 29px; border: 1px solid #dbe3ec; border-radius: 7px; color: #1d4ed8; background: #fff; font-size: 18px; }
.application-main h3 { margin: 4px 0; color: #1f2937; font-size: 13px; }
.application-main p { margin: 0; color: #64748b; font-size: 10px; }
.application-type { color: #2563eb; font-size: 9px; font-weight: 800; }
.license-matrix-item { display: grid; grid-template-columns: 1fr; }
.license-matrix-item small { color: #64748b; font-size: 8px; line-height: 1.5; }
.license-matrix-item.legacy { border-color: #fde68a; background: #fffbeb; }

/* Supplier list emphasis and compact permit rows */
.supplier-company-cell { min-width: 230px; }
.supplier-company-name { display: block; color: #172033; font-size: 15px; font-weight: 750; line-height: 1.35; }
.supplier-company-services { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; color: #64748b; font-size: 13px; font-weight: 500; line-height: 1.45; }
.supplier-company-services b { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; color: #64748b; background: #f1f5f9; font-size: 8px; font-weight: 700; letter-spacing: .03em; }
.preference-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.preference-badge.preferred { color: #b91c1c; background: #fee2e2; }
.preference-badge.limited { color: #a16207; background: #fef3c7; }
.preference-badge.standard { color: #64748b; background: #f1f5f9; }
.company-row, .supplier-card { cursor: pointer; }
.company-row:hover td { background: #f8fafc; }
.company-row:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }
.supplier-card:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.company-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.sanction-alert { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 3px 7px; border-radius: 999px; color: #b91c1c; background: #fee2e2; font-size: 8px; font-weight: 800; white-space: nowrap; }
.sanction-alert i { width: 6px; height: 6px; border-radius: 50%; background: #dc2626; }
.company-row.has-sanction td { background: #fff1f2; border-color: #fecdd3; }
.company-row.has-sanction:hover td { background: #ffe4e6; }
.supplier-card.has-sanction { border-color: #fda4af; background: #fff1f2; }
.company-row.is-suspended { opacity: .62; filter: grayscale(.85); }
.company-row.is-suspended td, .company-row.is-suspended:hover td { background: #f1f5f9; border-color: #dbe3ec; }
.supplier-card.is-suspended { border-color: #cbd5e1; background: #f1f5f9; opacity: .7; filter: grayscale(.85); }
.supplier-toolbar { grid-template-columns: minmax(260px,1.8fr) repeat(2,minmax(140px,.7fr)) auto; }
.customer-toolbar { grid-template-columns: minmax(260px,1fr) 200px auto; }
.suspended-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 7px 11px; border: 1px solid #d1d5db; border-radius: 8px; color: #475569; background: #f8fafc; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.suspended-toggle:has(input:checked) { border-color: #94a3b8; color: #334155; background: #e2e8f0; }
.suspended-toggle input { width: 15px; height: 15px; margin: 0; accent-color: #64748b; }
.license-detail-list { display: grid; margin: 0; padding: 0; border-top: 1px solid #e5e7eb; list-style: none; }
.license-detail-row { display: grid; grid-template-columns: 64px minmax(145px,.7fr) minmax(190px,1.3fr); align-items: center; gap: 12px; min-height: 44px; padding: 9px 2px; border-bottom: 1px solid #e5e7eb; }
.license-detail-row.simple { grid-template-columns: 64px 1fr; }
.license-detail-row > strong { color: #334155; font-size: 11px; font-weight: 700; }
.license-detail-meta { color: #64748b; font-size: 9px; line-height: 1.45; }
.permit-level { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 4px 8px; border-radius: 6px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.permit-level.special { color: #7e22ce; background: #f3e8ff; }
.permit-level.general { color: #1d4ed8; background: #dbeafe; }
.permit-level.registered { color: #047857; background: #d1fae5; }
.permit-level.unregistered { color: #64748b; background: #f1f5f9; }
.permit-level.pending { color: #a16207; background: #fef3c7; }
.license-detail-row.legacy { background: #fffbeb; }

@media (max-width: 1000px) {
  .user-control span { display: none; }
}

@media (max-width: 820px) {
  .user-control { margin-left: 0; }
  .user-control button { padding: 5px; font-size: 9px; }
}

@media (max-width: 1050px) {
  .supplier-toolbar { grid-template-columns: minmax(240px,1fr) repeat(2,minmax(130px,.65fr)); }
  .supplier-toolbar .suspended-toggle { grid-column: 1 / -1; justify-self: end; }
}

@media (max-width: 680px) {
  .supplier-toolbar, .customer-toolbar { grid-template-columns: 1fr; }
  .supplier-toolbar .suspended-toggle { grid-column: auto; justify-self: start; }
  .suspended-toggle { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .login-card { padding: 26px 20px; }
  .topbar { gap: 8px; }
  .breadcrumb { display: none; }
  .role-control { margin-left: auto; }
  .license-detail-row { grid-template-columns: 62px 1fr; gap: 8px 10px; }
  .license-detail-row.simple { grid-template-columns: 62px 1fr; }
  .license-detail-meta { grid-column: 2; }
}

/* Super administrator account directory */
.account-restricted-note { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 11px 14px; border: 1px solid #fde68a; border-radius: 9px; color: #6b4f12; background: #fffbeb; font-size: 12px; }
.account-restricted-note strong { flex: 0 0 auto; }
.account-restricted-note span { color: #806927; }
.account-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.account-summary { min-height: 86px; padding: 15px 17px; border: 1px solid #dbe3ec; border-radius: 11px; background: #fff; }
.account-summary span, .account-summary strong { display: block; }
.account-summary span { color: #64748b; font-size: 12px; font-weight: 700; }
.account-summary strong { margin-top: 8px; color: #1e293b; font-size: 22px; }
.account-summary.active { border-color: #bbf7d0; background: #f0fdf4; }
.account-summary.warning { border-color: #fde68a; background: #fffbeb; }
.account-summary.privileged { border-color: #bfdbfe; background: #eff6ff; }
.account-panel { overflow: hidden; }
.account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border-bottom: 1px solid #e5e7eb; }
.account-toolbar .search-box { width: min(520px, 100%); }
#accountLoadStatus { color: #64748b; font-size: 12px; font-weight: 700; }
#accountLoadStatus.is-error { color: #b91c1c; }
.account-table th, .account-table td { vertical-align: middle; }
.account-table td strong { color: #1e293b; font-size: 13px; }
.account-role, .account-state, .account-confirmed, .account-unconfirmed { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.account-role.general { color: #166534; background: #dcfce7; }
.account-role.admin { color: #1d4ed8; background: #dbeafe; }
.account-role.super_admin { color: #92400e; background: #fef3c7; }
.account-role.unconfigured { color: #a16207; background: #fef3c7; }
.account-state.active, .account-confirmed { color: #047857; background: #d1fae5; }
.account-state.suspended { color: #b91c1c; background: #fee2e2; }
.account-state.unlinked, .account-unconfirmed { color: #a16207; background: #fef3c7; }
.account-card { padding: 15px; border: 1px solid #dbe3ec; border-radius: 10px; background: #fff; }
.account-card > div:first-child strong, .account-card > div:first-child span { display: block; }
.account-card > div:first-child strong { color: #1e293b; font-size: 14px; }
.account-card > div:first-child span { margin-top: 4px; color: #64748b; font-size: 12px; }
.account-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; color: #64748b; font-size: 11px; }

@media (max-width: 900px) {
  .account-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .account-summary-grid { grid-template-columns: 1fr; }
  .account-restricted-note, .account-toolbar { align-items: flex-start; flex-direction: column; }
}
