﻿:root {
  /* Swiss Ops — ink / paper / hairline · radius 0 · no soft shadow */
  --color-primary: #1e3a8a;
  --color-primary-hover: #1e40af;
  --color-primary-soft: #e8eef8;
  --color-accent: #0f766e;
  --color-accent-soft: #e6f2f0;
  --color-bg: #f4f1ea;
  --color-surface: #ffffff;
  --color-surface-muted: #fafaf9;
  --color-border: #111827;
  --color-border-strong: #111827;
  --color-text: #111827;
  --color-text-muted: #4b5563;
  --color-success: #166534;
  --color-success-soft: #dcfce7;
  --color-warning: #c2410c;
  --color-warning-soft: #ffedd5;
  --color-danger: #9f1239;
  --color-danger-soft: #ffe4e6;
  --color-info: #1e3a8a;
  --radius: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --shadow: none;
  --sidebar-width: 232px;
  --font: "BIZ UDPGothic", "Hiragino Sans", "Meiryo", sans-serif;
  /* Ranking (muted warm / cool — still distinct, not neon) */
  --rank-acq-ink: #5c1a1a;
  --rank-acq-mid: #8b3a3a;
  --rank-acq-soft: #e4c8c8;
  --rank-acq-wash: #f3e8e8;
  --rank-avg-ink: #1a4744;
  --rank-avg-mid: #3d6f6a;
  --rank-avg-soft: #c5d9d6;
  --rank-avg-wash: #e4efed;
  --rank-below: #ead9d9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #0b1220;
  color: #e2e8f0;
  padding: 14px 10px;
  border-right: 1px solid var(--color-border);
}

.main-content.is-nav-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  margin-bottom: 8px;
}

.sidebar__nav {
  display: block;
}

.sidebar__logo {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: var(--color-primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.sidebar__title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar__subtitle {
  font-size: 12px;
  color: #94a3b8;
}

.sidebar__section {
  margin: 14px 0 6px;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  margin: 1px 0;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 13px;
  transition: background 0.12s, color 0.12s;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar__link.is-active {
  background: #fff;
  color: var(--color-text);
  border-color: #fff;
  box-shadow: none;
  font-weight: 700;
}

.sidebar__icon {
  width: 18px;
  text-align: center;
  opacity: 0.9;
}

.sidebar__badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.sidebar__link.is-active .sidebar__badge {
  background: #dc2626;
}

.sidebar__footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: none;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__menu {
  display: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.topbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
}

.user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.user-chip__name {
  font-size: 14px;
  font-weight: 600;
}

.user-chip__role {
  font-size: 12px;
  color: var(--color-text-muted);
}

.main-content {
  padding: 12px 16px 20px;
  max-width: 1560px;
  width: 100%;
}

/* Auth layout */
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--color-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.auth-card__hero {
  padding: 22px 22px 16px;
  background: var(--color-primary);
  color: #fff;
}

.auth-card__hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.auth-card__hero p {
  margin: 0;
  opacity: 0.92;
  font-size: 14px;
}

.auth-card__body {
  padding: 28px;
}

.password-field {
  position: relative;
  display: flex;
  align-items: stretch;
}

.password-field__input {
  padding-right: 64px;
}

.password-field__toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.password-field__toggle:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}

.password-field__toggle:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* Components */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 10px;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.card__body {
  padding: 8px 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 10px;
  border: 1px solid var(--color-border);
}

.stat-card {
  background: var(--color-surface);
  border: 0;
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  padding: 8px 10px;
  box-shadow: none;
}

.stat-card:last-child {
  border-right: 0;
}

.stat-card__label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.stat-card__value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-card__hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.stat-card--accent .stat-card__value {
  color: var(--color-accent);
}

.stat-card--primary .stat-card__value {
  color: var(--color-primary);
}

.stat-card--warning .stat-card__value {
  color: var(--color-warning);
}

/* ===== Dashboard blocks ===== */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.dash-hero__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.dash-hero__meta {
  margin: 2px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}
.dash-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-block {
  background: var(--color-surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 14px;
  overflow: hidden;
}
.dash-block__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px 8px;
  border-bottom: 0;
  background: transparent;
}
.dash-block__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-block__title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 0;
  background: var(--color-primary);
}
.dash-block--alerts {
  background: #fecdd3;
}
.dash-block--alerts .dash-block__title {
  color: #9f1239;
}
.dash-block--alerts .dash-block__title::before {
  background: #be123c;
}
.dash-block--perf {
  background: #bfdbfe;
}
.dash-block--perf .dash-block__title {
  color: #1e3a8a;
}
.dash-block--perf .dash-block__title::before {
  background: #1d4ed8;
}
.dash-block--attendance {
  background: #bbf7d0;
}
.dash-block--attendance .dash-block__title {
  color: #14532d;
}
.dash-block--attendance .dash-block__title::before {
  background: #15803d;
}
.dash-block--shift {
  background: #fed7aa;
}
.dash-block--shift .dash-block__title {
  color: #9a3412;
}
.dash-block--shift .dash-block__title::before {
  background: #c2410c;
}
.dash-block__period {
  font-size: 12px;
  color: var(--color-text-muted);
}
.dash-block__link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
}
.dash-block__body {
  padding: 8px 14px 14px;
}
.dash-block--alerts .dash-block__body {
  padding: 8px 14px 14px;
}
.dash-block--alerts .ack-alert {
  margin: 0 0 8px;
  padding: 14px 16px;
  border: 0;
  border-left: 6px solid #be123c;
  background: #fff;
  box-shadow: 0 1px 3px rgba(159, 18, 57, 0.12);
}
.dash-block--alerts .ack-alert:last-child {
  margin-bottom: 0;
}
.dash-block--alerts .ack-alert__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.dash-block--alerts .dash-empty {
  font-size: 16px;
  font-weight: 600;
}
.dash-empty {
  margin: 4px 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.dash-block__body--panel {
  padding: 8px 14px 14px;
}
.dash-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dash-panel__block {
  display: flex;
  flex-direction: column;
  border: 0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.dash-panel__block .dash-panel__tile {
  border: 0;
  border-left: 0;
  border-radius: 0;
  flex: 1;
  background: transparent;
}
.dash-panel__block .dash-panel__tile + .dash-panel__tile {
  border-top: 0;
  background: #f8fafc;
}
.dash-panel__tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
}
.dash-panel__tile--primary {
  border-left-color: transparent;
}
.dash-panel__tile--primary .dash-panel__value {
  color: var(--color-primary);
}
.dash-panel__tile--warning {
  border-left-color: transparent;
}
.dash-panel__tile--warning .dash-panel__value {
  color: var(--color-warning);
}
.dash-panel__tile--accent {
  border-left-color: transparent;
}
.dash-panel__tile--accent .dash-panel__value {
  color: var(--color-accent);
}
.dash-panel__label {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}
.dash-panel__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  line-height: 1;
  min-width: 0;
}
.dash-panel__value {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.dash-panel__unit {
  font-size: 16px;
  font-weight: 700;
  margin-left: 1px;
  color: var(--color-text-muted);
}
.dash-panel__sub {
  margin-left: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.dash-panel__side {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}
.dash-panel__side .dash-panel__cheer {
  margin-left: 0;
  font-size: 13px;
  padding: 4px 10px;
}
.dash-panel__side .dash-delta {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  border-radius: 0;
  padding: 5px 10px;
}
.dash-panel__delta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.dash-panel__delta .dash-delta {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  border-radius: 0;
  padding: 5px 10px;
}

.dash-panel__value .dash-crown {
  display: inline-block;
  vertical-align: -4px;
  margin-right: 4px;
  flex-shrink: 0;
}
.dash-panel__rank-num {
  font-size: inherit;
  font-weight: inherit;
}
.dash-panel__cheer {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  border: 1px solid currentColor;
}

.dash-panel__tile--rank10 {
  background: linear-gradient(135deg, #e0f2fe 0%, rgba(255, 255, 255, 0.55) 70%);
}
.dash-panel__tile--rank10 .dash-panel__rank-num {
  color: #0369a1;
}
.dash-panel__tile--rank10 .dash-panel__cheer {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.dash-panel__tile--rank3 {
  background: linear-gradient(135deg, #e2e8f0 0%, rgba(255, 255, 255, 0.55) 70%);
}
.dash-panel__tile--rank3 .dash-panel__rank-num {
  color: #334155;
  font-size: 40px;
}
.dash-panel__tile--rank3 .dash-panel__cheer {
  color: #334155;
  background: #e2e8f0;
  border-color: #94a3b8;
}

.dash-panel__tile--rank1 {
  background: linear-gradient(135deg, #fde68a 0%, #fffbeb 45%, rgba(255, 255, 255, 0.65) 100%);
  box-shadow: none;
  animation: dash-rank1-glow 2.4s ease-in-out infinite;
}
.dash-panel__tile--rank1 .dash-panel__rank-num {
  color: #b45309;
  font-size: 44px;
}
.dash-panel__tile--rank1 .dash-panel__cheer {
  color: #92400e;
  background: #fde68a;
  border-color: #f59e0b;
}
.dash-panel__tile--rank1 .dash-crown {
  width: 32px;
  height: 32px;
  animation: dash-crown-bob 1.6s ease-in-out infinite;
}

@keyframes dash-rank1-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.04); }
}
@keyframes dash-crown-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .dash-panel__tile--rank1,
  .dash-panel__tile--rank1 .dash-crown {
    animation: none;
  }
}

@media (max-width: 960px) {
  .dash-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .dash-panel {
    grid-template-columns: 1fr;
  }
}

.dash-metrics {
  display: grid;
  gap: 8px;
}
.dash-metrics--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dash-metrics--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dash-metrics--stacks {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.dash-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  min-height: 100%;
}
.dash-stack__title {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}
.dash-stack__primary .dash-metric {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
}
.dash-stack__secondary {
  border-top: 1px dashed var(--color-border);
  background: #f7fafc;
}
.dash-stack__secondary .dash-metric {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
}
.dash-metric {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-block--attendance .dash-metric {
  border: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  padding: 12px 14px;
}
.dash-block--attendance .dash-metrics {
  gap: 10px;
}
.dash-block--shift .shiftcal {
  border: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.dash-block--shift .shiftcal__cell {
  border-color: rgba(154, 52, 18, 0.14);
}
.dash-metric--row .dash-metric__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.dash-metric--row .dash-metric__value {
  flex: 0 1 auto;
  min-width: 0;
}
.dash-metric--row .dash-metric__delta {
  margin-top: 0;
  padding-top: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
  text-align: right;
}
.dash-metric--compact {
  min-height: 0;
  padding: 8px 10px;
}
.dash-metric--compact .dash-metric__value {
  font-size: 20px;
}
.dash-metric--compact .dash-metric__label {
  margin-bottom: 2px;
}
.dash-metric__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.dash-metric__value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
}
.dash-metric__unit {
  font-size: 13px;
  font-weight: 600;
  margin-left: 2px;
  color: var(--color-text-muted);
}
.dash-metric__sub {
  display: inline;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  vertical-align: baseline;
}
.dash-metric__hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.dash-metric__delta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dash-metric--primary .dash-metric__value { color: var(--color-primary); }
.dash-metric--accent .dash-metric__value { color: var(--color-accent); }
.dash-metric--warning .dash-metric__value { color: var(--color-warning); }

.dash-delta {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  background: #e2e8f0;
  color: var(--color-text-muted);
}
.dash-delta--up {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.dash-delta--down {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.dash-delta--flat,
.dash-delta--na {
  background: #e2e8f0;
  color: var(--color-text-muted);
}

@media (max-width: 960px) {
  .dash-metrics--3,
  .dash-metrics--4,
  .dash-metrics--stacks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .dash-metrics--3,
  .dash-metrics--4,
  .dash-metrics--stacks {
    grid-template-columns: 1fr;
  }
  .dash-hero__title {
    font-size: 18px;
  }
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  box-shadow: none;
}

.btn:hover {
  transform: none;
  background: var(--color-surface-muted);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: none;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn--accent {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: none;
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--lg {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 0;
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--color-border);
}

.badge--pending {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge--approved,
.badge--success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge--rejected,
.badge--danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.badge--info {
  background: var(--color-primary-soft);
  color: var(--color-info);
}

.alert {
  padding: 14px 16px;
  border-radius: 0;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert--danger {
  background: var(--color-danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert--warning {
  background: var(--color-warning-soft);
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert--success {
  background: var(--color-success-soft);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert--info {
  background: var(--color-primary-soft);
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.form {
  display: grid;
  gap: 16px;
}

.form__group {
  display: grid;
  gap: 6px;
}

.form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form__input,
.form__select,
.form__textarea {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: none;
}

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form__help {
  font-size: 12px;
  color: var(--color-text-muted);
}

.form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.25;
  background: var(--color-surface);
}

.table th,
.table td {
  padding: 2px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: var(--color-text);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

/* ランキング表は .table も兼ねるため、順位色を潰さない */
.table:not(.rank-table) tbody tr:nth-child(even) {
  background: #f8fafc;
}

.table:not(.rank-table) tbody tr:hover {
  background: #e8eef6;
}

/* 表内の操作UIも行高に合わせて低く */
.table .badge {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 4px;
}

.table select,
.table .btn,
.table .btn--sm,
.table .btn--ghost,
.table .btn--secondary,
.table input[type="text"],
.table input[type="email"],
.table input[type="password"],
.table input[type="number"],
.table input[type="date"],
.table input[type="month"],
.table input:not([type]),
.table .form__input {
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 6px;
}

.table .inline-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.data-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.data-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.data-list li:last-child {
  border-bottom: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
}

.filter-pill:hover,
.filter-pill.is-active {
  background: var(--color-primary-soft);
  border-color: #93c5fd;
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--color-text-muted);
}

.inline-form {
  display: inline;
}

.stack-sm > * + * {
  margin-top: 8px;
}

.stack-md > * + * {
  margin-top: 16px;
}

.text-muted {
  color: var(--color-text-muted);
}

.role-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
}

/* Legacy page auto-styling */
.main-content > h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}

.main-content > p {
  margin: 0 0 12px;
}

.main-content > form:not(.clock-actions):not(.inline-form) {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.main-content > form:not(.clock-actions):not(.inline-form) label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.main-content > form:not(.clock-actions):not(.inline-form) input,
.main-content > form:not(.clock-actions):not(.inline-form) select,
.main-content > form:not(.clock-actions):not(.inline-form) textarea {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  font: inherit;
}

.main-content > form:not(.clock-actions):not(.inline-form) button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 0;
  background: var(--color-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.main-content > ul:not(.data-list) {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.main-content > ul:not(.data-list) li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.main-content > ul:not(.data-list) li:last-child {
  border-bottom: none;
}

.clock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* ===== 打刻 ===== */
.btn--sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}

.att-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.att-clock__date {
  font-size: 15px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.att-clock__time {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.att-status {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
}

.att-status--idle {
  background: var(--color-border);
  color: var(--color-text-muted);
}

.att-status--working {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.att-status--done {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.att-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.att-summary__item {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
}

.att-summary__label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.att-summary__value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.att-actions {
  display: flex;
  gap: 12px;
}

.att-btn {
  flex: 1;
}

.att-note {
  color: var(--color-text-muted);
  font-size: 13px;
  margin: 8px 0 0;
}

.att-note--done {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  padding: 14px;
}

/* ===== シフトカレンダー ===== */
.shiftcal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.shiftcal__month {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.shiftcal__userform {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.shiftcal__userform select {
  margin-left: 6px;
  min-width: 12em;
}

.card__header .shiftcal__userform {
  margin-left: auto;
}

.shiftcal {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
}

.shiftcal__head,
.shiftcal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.shiftcal__dow {
  padding: 10px 6px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  background: var(--color-bg, #f1f5f9);
  border-bottom: 1px solid var(--color-border);
}

.shiftcal__dow--sun {
  color: #dc2626;
}

.shiftcal__dow--sat {
  color: #2563eb;
}

.shiftcal__cell {
  min-height: 120px;
  padding: 5px 4px 6px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: visible;
}

.shiftcal__cell:nth-child(7n) {
  border-right: none;
}

.shiftcal__cell--outside {
  background: #fafafa;
  opacity: 0.55;
}

.shiftcal__cell--link {
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
  font: inherit;
  text-align: left;
  width: 100%;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

button.shiftcal__cell--link {
  margin: 0;
}

.shiftcal__cell--link:hover {
  background: #f0f7ff;
}

.shiftcal__cell--link:focus-visible {
  outline: 2px solid var(--color-accent, #0d9488);
  outline-offset: -2px;
  z-index: 1;
}

.shiftcal__more {
  margin-top: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent, #2563eb);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.shiftcal__cell--link:hover .shiftcal__more {
  opacity: 1;
}

.shiftcal__total td {
  font-weight: 700;
  background: var(--color-surface-muted);
  border-top: 2px solid var(--color-border);
}

/* 日次勤怠など: table--dense は共通.table と同等（互換クラス） */
.table--dense {
  font-size: 12px;
  line-height: 1.25;
}

.table--dense th,
.table--dense td {
  padding: 2px 8px;
  vertical-align: middle;
  white-space: nowrap;
}

.table--dense th {
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.shift-day-roster.table-wrap {
  max-height: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

.shift-day-roster .table--dense {
  border-top: 1px solid var(--color-border);
}

.shiftcal__hint-text {
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
}

.shiftcal__summary {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.shiftcal__summary--empty {
  color: #cbd5e1;
  font-size: 18px;
  align-items: center;
  width: 100%;
}

.shiftcal__badge {
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 6px;
  padding: 1px 8px;
}

.shiftcal__hours {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.shiftcal__md {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
}

@media (max-width: 768px) {
  .shiftcal__badge {
    font-size: 11px;
    padding: 1px 5px;
  }

  .shiftcal__hours,
  .shiftcal__md {
    font-size: 10px;
  }
}

.shiftcal__cell--today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px var(--color-accent, #2563eb);
}

.shiftcal__num {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
}

.shiftcal__num--sun {
  color: #dc2626;
}

.shiftcal__num--sat {
  color: #2563eb;
}

.shiftcal__chip {
  font-size: 12px;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 600;
}

.shiftcal__entries {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-width: 0;
}

.shiftcal__entry {
  background: rgba(37, 99, 235, 0.10);
  border-radius: 6px;
  padding: 4px 6px;
  line-height: 1.3;
}

.shiftcal__range {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  white-space: nowrap;
  overflow: visible;
  letter-spacing: 0;
}

.shiftcal__break {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.shiftcal__split {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
  border-radius: 4px;
  padding: 2px 6px;
  text-align: center;
  white-space: nowrap;
}

/* シフト画面: 画面幅いっぱいまで広げてカレンダーを広く */
.page-shifts .main-content {
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}

/* ロードマップ: 日次明細が横に見切れないよう幅いっぱいに */
.page-roadmap .main-content {
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}

.page-shifts .shift-editor {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.page-shifts .shiftcal__cell {
  min-height: 128px;
  padding: 6px 5px;
}

.page-shifts .shiftcal__num {
  font-size: 14px;
}

.page-shifts .shiftcal__range {
  font-size: 14px;
}

.page-shifts .shiftcal__break {
  font-size: 12px;
}

@media (min-width: 1400px) {
  .page-shifts .shift-editor {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .page-shifts .shiftcal__range {
    font-size: 15px;
  }

  .page-shifts .shiftcal__break {
    font-size: 13px;
  }

  .page-shifts .shiftcal__cell {
    min-height: 140px;
  }
}

.shiftcal__brk {
  font-weight: 400;
  color: #64748b;
}

.shiftcal__cell--selected {
  background: #fff7ed;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.shiftcal__chip--split {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.shift-clipbar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* カレンダー＋同画面の時間入力 */
.shift-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin-top: 8px;
}

.shift-editor__panel {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.shift-editor__day {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.shift-editor__dayrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.shift-clipbar {
  display: flex;
  gap: 6px;
}

.shift-clip-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
  line-height: 1.4;
}

.shift-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.shift-editor__empty {
  margin: 0;
  font-size: 13px;
}

.shift-editor__hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 10px;
}

.shift-editor__form.card {
  margin: 0;
}

.shift-block {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--color-surface-muted);
}

.shift-block + .shift-block {
  margin-top: 8px;
}

.shift-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.shift-block__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shift-block__time {
  font-size: 16px;
  font-weight: 700;
}

.shift-block__break {
  font-size: 13px;
  color: var(--color-text-muted, #64748b);
  margin-top: 2px;
}

.shift-block__del {
  display: inline;
  margin: 0;
}

.shift-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.shift-form__grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}

.shift-form__grid input,
.shift-form__grid select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.shift-form__pick {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.shift-editor__form .card__body {
  overflow: hidden;
}

.shift-block--editing {
  border-color: #f59e0b;
  background: #fffbeb;
}

.shift-block--draft {
  border-style: dashed;
  background: #fff7ed;
}

.shift-block__tag {
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  background: #ffedd5;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}

.shift-block__tag--ok {
  color: #047857;
  background: #d1fae5;
}

.shift-block__tag--pending {
  color: #1d4ed8;
  background: #dbeafe;
}

.shift-block--pending {
  border-color: #93c5fd;
  background: #eff6ff;
}

.shiftcal__entry--draft {
  background: rgba(245, 158, 11, 0.14);
  border: 1px dashed #f59e0b;
}

.shiftcal__entry--pending {
  background: rgba(59, 130, 246, 0.12);
  border: 1px dashed #3b82f6;
}

.shiftcal__split--draft {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.shiftcal__split--pending {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.shift-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
}

.shift-confirm-bar--locked {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.shift-confirm-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.shift-confirm-badge--open {
  background: #ffedd5;
  color: #c2410c;
}

.shift-confirm-badge--unlocked {
  background: #dbeafe;
  color: #1d4ed8;
}

.shift-confirm-badge--confirmed {
  background: #d1fae5;
  color: #047857;
}

.shift-confirm-row--pending {
  background: #fffbeb;
}

.inline-form {
  display: inline;
  margin: 0;
}

.shift-form__note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.shift-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 960px) {
  .shift-editor {
    grid-template-columns: 1fr;
  }

  .shift-editor__panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .shiftcal__cell {
    min-height: 92px;
    padding: 3px 2px 4px;
  }

  .shiftcal__chip {
    font-size: 10px;
    padding: 2px 3px;
  }

  .shiftcal__range {
    font-size: 11px;
  }

  .shiftcal__break,
  .shiftcal__split {
    font-size: 10px;
  }

  .page-shifts .shift-editor {
    grid-template-columns: 1fr;
  }

  .shiftcal__dow {
    font-size: 11px;
    padding: 6px 2px;
  }

  .shift-form__grid {
    grid-template-columns: 1fr;
  }

  .shift-clipbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.emp-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.emp-search__input {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  min-width: 220px;
}

/* 従業員一覧（スプレッドシート風） */
.emp-sheet {
  margin: 0 -4px;
}

.emp-sheet__table {
  font-size: 12px;
  margin: 0;
}

.emp-sheet__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  background: var(--color-surface-muted);
}

.emp-sheet__table td {
  padding: 2px 8px;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}

.emp-sheet__row {
  cursor: pointer;
}

.emp-sheet__row:hover td {
  background: var(--color-surface-muted);
}

.emp-sheet__code {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.emp-sheet__name {
  font-weight: 600;
}

.emp-sheet__spec {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.emp-tabs__link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 14px;
}

.emp-tabs__link.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.emp-tabs__link:hover {
  color: var(--color-primary);
}

.emp-tabs__link.is-active:hover {
  color: #fff;
}

.team-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-pool {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-muted);
  overflow: hidden;
}

.team-pool__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.team-pool__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.team-pool__body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  min-height: 72px;
  max-height: 180px;
  overflow-y: auto;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.team-pool__body.is-over {
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.team-board__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.team-col {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  min-height: 220px;
  max-height: 360px;
}

.team-col--hint {
  min-height: 120px;
  grid-column: 1 / -1;
}

.team-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.team-col__head-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.team-col__delete {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.55;
}

.team-col__delete:hover {
  opacity: 1;
  background: #fee2e2;
}

.team-col__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.team-col__count {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex: 0 0 auto;
}

.team-col__warn {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  text-align: center;
}

.team-col__body {
  flex: 1 1 auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.team-col__body.is-over {
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.team-col__empty {
  margin: 16px 4px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

.team-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  box-shadow: none;
}

.team-pool__body .team-chip {
  flex: 0 1 150px;
  max-width: 180px;
}

.team-chip.is-dragging {
  opacity: 0.5;
}

.team-chip__main {
  flex: 1 1 auto;
  min-width: 0;
}

.team-chip__main strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chip__meta {
  display: block;
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chip__leader {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}

.team-chip__leader.is-on {
  color: #d97706;
  border-color: #fbbf24;
  background: #fffbeb;
}

.team-board-flash {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.team-board-flash.is-ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #047857;
}

.team-board-flash.is-err {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.entry-form__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
}

.entry-form--stacked {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.entry-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  padding: 14px 18px 18px;
}

.entry-fieldset__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-soft);
}

.entry-fieldset__rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
}

.entry-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 12px;
}

.entry-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: right;
}

.entry-field input,
.entry-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.entry-field--wide {
  grid-column: 1 / -1;
  grid-template-columns: 110px 1fr;
}

.entry-field--check {
  align-items: center;
}

.entry-field--check input {
  width: 18px;
  height: 18px;
}

.entry-form__full {
  grid-column: 1 / -1;
}

.entry-form__check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.entry-search select,
.entry-search input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.entry-filter-sep {
  display: inline-block;
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 4px;
  vertical-align: middle;
}

.entry-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.entry-table {
  min-width: 1400px;
  font-size: 12px;
}

.entry-table th,
.entry-table td {
  white-space: nowrap;
  padding: 2px 8px;
  vertical-align: middle;
}

.entry-notes {
  max-width: 180px;
  white-space: normal;
  word-break: break-word;
}

.req {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.entry-form__note {
  color: var(--color-text-muted);
  font-size: 12px;
  margin: 10px 0 0;
}

.entry-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 14px;
}

.entry-alert--err {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.entry-alert--ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #047857;
}

/* アラート（要確認・未確認周知・コンパクト横帯・赤系） */
.ack-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  background: var(--color-danger-soft);
  border: 1px solid var(--color-danger);
  border-left-width: 4px;
  color: var(--color-danger);
  border-radius: 0;
  padding: 5px 10px;
  margin-bottom: 10px;
  box-shadow: none;
}

.ack-alert--compact {
  padding: 8px 12px;
  margin-bottom: 8px;
}

a.ack-alert--link {
  text-decoration: none;
  color: var(--color-danger);
  cursor: pointer;
  transition: background 0.12s ease;
}
a.ack-alert--link:hover,
a.ack-alert--link:focus-visible {
  background: #fecdd3;
  outline: none;
}

.ack-alert__title {
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
}

.ack-alert__warn {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  margin-left: 8px;
}

.ack-banner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ack-banner--sm {
  padding: 8px 12px;
  margin: 8px 0 12px;
  font-weight: 500;
  font-size: 13px;
}

.ack-banner--ok {
  background: var(--color-success-soft);
  border: 1px solid #86efac;
  color: #166534;
}

.ack-banner--ng {
  background: var(--color-danger-soft);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.ack-banner--warn {
  background: var(--color-warning-soft);
  border: 1px solid #fcd34d;
  color: #92400e;
  white-space: normal;
}

.ack-banner__badge {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ack-banner--sm .ack-banner__badge {
  font-size: 15px;
}

/* 本人の未確認件数（コンパクト） */
.ann-mine-banner {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid transparent;
}

.ann-mine-banner--ng {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.ann-mine-banner--ok {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.ann-mine-banner__label {
  font-size: 13px;
  font-weight: 700;
}

.ann-mine-banner__count {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.ann-mine-banner__unit {
  font-size: 13px;
  font-weight: 700;
}

/* 周知ページのセクション見出し */
.ann-section-title {
  margin: 24px 0 12px;
  padding: 0 2px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
  border-left: 4px solid var(--color-accent, #0d9488);
  padding-left: 10px;
  line-height: 1.3;
}

.ann-section-title:first-child {
  margin-top: 8px;
}

.ann-section-title--archive {
  margin-top: 0;
  border-left-color: #64748b;
  color: var(--color-text-muted);
}

.ann-block {
  margin-top: 8px;
}

.ann-block--done {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.ann-archive-note {
  margin: -4px 0 12px 2px;
  font-size: 13px;
}

.ann-sheet--archive {
  opacity: 0.95;
}

.ann-sheet--archive .ann-sheet__head {
  background: #f1f5f9;
}

.ann-archived-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--color-border);
}

.ann-archived-row:last-child {
  border-bottom: none;
}

.ann-archived-row > .ann-sheet__item {
  border-bottom: none;
  min-width: 0;
}

.ann-unack-form {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  background: #f8fafc;
  border-left: 1px solid var(--color-border);
}

.ann-target-picker {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #f8fafc;
}

.ann-target-picker__list {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.ann-sheet__item--archived > .ann-sheet__row {
  background: #f8fafc;
  color: var(--color-text-muted);
}

.ann-sheet__item--archived > .ann-sheet__row:hover {
  background: #eef2f7;
}

.ann-fold__summary--simple {
  grid-template-columns: auto 1fr;
}

.ann-fold__summary--simple .ann-fold__meta {
  grid-column: auto;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: 0;
}

/* 周知投稿フォームの折りたたみ */
.ann-fold {
  padding: 0;
  overflow: hidden;
}

.ann-fold__summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--color-surface);
}

.ann-fold__summary::-webkit-details-marker {
  display: none;
}

.ann-fold__summary::before {
  content: "▶";
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1;
  grid-row: 1;
  grid-column: 1;
}

.ann-fold[open] > .ann-fold__summary::before {
  content: "▼";
}

.ann-fold__title {
  font-size: 16px;
  font-weight: 700;
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
}

.ann-fold__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--color-border);
}

/* 周知一覧（スプレッドシート風） */
.ann-sheet {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.ann-sheet__head,
.ann-sheet__row {
  display: grid;
  grid-template-columns: minmax(140px, 1.6fr) 64px 64px minmax(72px, 0.8fr) 96px 96px;
  gap: 0 8px;
  align-items: center;
  padding: 0 8px 0 24px;
  min-height: 26px;
  font-size: 12px;
}

.ann-sheet--admin .ann-sheet__head,
.ann-sheet--admin .ann-sheet__row,
.ann-sheet__item--admin > .ann-sheet__row {
  grid-template-columns: minmax(120px, 1.3fr) 64px 64px minmax(72px, 0.7fr) 64px minmax(120px, 1.5fr) 96px 96px;
}

.ann-sheet__head {
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ann-sheet__item {
  border-bottom: 1px solid var(--color-border);
}

.ann-sheet__item:last-child {
  border-bottom: none;
}

.ann-sheet__item--mine-pending > .ann-sheet__row {
  background: #fef2f2;
}

.ann-sheet__row {
  list-style: none;
  cursor: pointer;
  position: relative;
}

.ann-sheet__row::-webkit-details-marker {
  display: none;
}

.ann-sheet__row::before {
  content: "▶";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 10px;
}

.ann-sheet__item[open] > .ann-sheet__row::before {
  content: "▼";
}

.ann-sheet__row:hover {
  background: var(--color-surface-muted);
}

.ann-sheet__title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ann-sheet__aud,
.ann-sheet__author,
.ann-sheet__me,
.ann-sheet__prog,
.ann-sheet__dl,
.ann-sheet__date {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ann-sheet__pending {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.ann-sheet__ok {
  color: #166534;
  font-weight: 600;
}

.ann-sheet__ng {
  color: #991b1b;
  font-weight: 600;
}

.ann-sheet__detail {
  padding: 12px 16px 16px 28px;
  background: #fafbfc;
  border-top: 1px dashed var(--color-border);
  font-size: 14px;
}

.ann-sheet__detail-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

@media (max-width: 960px) {
  .ann-sheet {
    overflow-x: auto;
  }
  .ann-sheet__head,
  .ann-sheet__row {
    min-width: 560px;
  }
  .ann-sheet--admin .ann-sheet__head,
  .ann-sheet--admin .ann-sheet__row,
  .ann-sheet__item--admin > .ann-sheet__row {
    min-width: 860px;
  }
}

.master-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
}

.master-block:last-child {
  border-bottom: none;
}

.master-block__label {
  font-weight: 700;
  min-width: 48px;
}

.master-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.master-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}

.master-chip__del {
  display: inline;
}

.master-chip__del button {
  border: none;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.master-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

.master-add input {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.master-block--order {
  display: block;
}

.master-details {
  padding: 0;
}

.master-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  user-select: none;
}

.master-summary::-webkit-details-marker {
  display: none;
}

.master-summary::before {
  content: "▶";
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}

.master-details[open] .master-summary::before {
  transform: rotate(90deg);
}

.master-summary__title {
  font-weight: 700;
  font-size: 15px;
}

.master-summary__hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

.field-order__note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 4px 0 10px;
}

.field-order {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  max-width: 520px;
}

.field-order__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.field-order__item.is-dragging {
  opacity: 0.4;
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.field-order__item.drop-before {
  box-shadow: 0 -3px 0 0 var(--color-primary);
}

.field-order__item.drop-after {
  box-shadow: 0 3px 0 0 var(--color-primary);
}

.field-order__handle {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: grab;
  padding: 0 4px;
  touch-action: none;
}

.field-order__handle:active {
  cursor: grabbing;
}

.field-order__name {
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
}

.field-order__req {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: min(86vw, var(--sidebar-width));
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 20;
  }

  .sidebar-backdrop.is-open {
    display: block;
  }

  .topbar__menu {
    display: inline-flex;
  }

  .main-content {
    padding: 18px 16px 32px;
  }

  .stat-grid,
  .form__row,
  .clock-actions {
    grid-template-columns: 1fr;
  }

  .entry-form__grid {
    grid-template-columns: 1fr;
  }

  .entry-fieldset__rows {
    grid-template-columns: 1fr;
  }

  .entry-field {
    grid-template-columns: 90px 1fr;
  }
}

/* --- Ranking（スプレッドシート風） --- */
.rank-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.rank-card__header--compact {
  align-items: center;
  gap: 12px 20px;
}

.rank-card__header--compact .card__title {
  margin: 0;
  white-space: nowrap;
}

.rank-card__body--toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.rank-meta-inline {
  font-size: 13px;
  color: var(--color-text-muted);
}

.rank-card__sub {
  margin: 4px 0 0;
  font-size: 13px;
}

.rank-filter {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-left: 0;
}

.rank-filter__period {
  display: inline-flex;
  border: 1px solid var(--color-border, #1a1a1a);
}

.rank-filter__seg {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rank-filter__seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rank-filter__seg span {
  display: block;
  padding: 6px 12px;
  background: transparent;
  color: var(--color-text, #1a1a1a);
  border-right: 1px solid var(--color-border, #1a1a1a);
}

.rank-filter__seg:last-child span {
  border-right: 0;
}

.rank-filter__seg input:checked + span {
  background: var(--color-ink, #1a1a1a);
  color: var(--color-paper, #f4f1ea);
}

.rank-filter__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-filter__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #666);
}

.rank-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rank-nav input[type="month"],
.rank-nav input[type="date"],
.rank-filter input[type="month"],
.rank-filter input[type="date"] {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--color-border, #1a1a1a);
  background: #fff;
  font-size: 13px;
}

.rank-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--color-border, #1a1a1a);
  background: #fff;
  color: var(--color-text, #1a1a1a);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.rank-nav__btn:hover {
  background: var(--color-paper, #f4f1ea);
}

.rank-nav__btn--disabled {
  opacity: 0.35;
  pointer-events: none;
}

.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.rank-meta--export {
  margin-top: -4px;
  word-break: break-all;
}

.rank-meta--export a {
  color: var(--color-primary, #1d4ed8);
}

.rank-admin-form {
  margin-top: 8px;
}

.rank-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}

.rank-sheet {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.rank-sheet__banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  color: #fff;
}

.rank-sheet--acq .rank-sheet__banner {
  background: var(--rank-acq-ink);
}

.rank-sheet--avg .rank-sheet__banner {
  background: var(--rank-avg-ink);
}

.rank-sheet--kdi .rank-sheet__banner {
  background: #334155;
}

.rank-sheet__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
}

.rank-sheet__title-note {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.95;
}

.rank-sheet__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.95;
}

.rank-sheet__date {
  font-weight: 700;
}

.rank-sheet__warn {
  color: #fecaca;
  font-weight: 700;
}

.rank-sheet__ok {
  color: #bbf7d0;
  font-weight: 700;
}

.rank-sheet__totals {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.rank-sheet__foot {
  margin: 0;
  padding: 8px 12px 10px;
  font-size: 11px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.rank-table-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
  border: 0;
  border-radius: 0;
}

.rank-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
}

.rank-table th,
.rank-table td {
  text-align: center;
  vertical-align: middle;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.rank-table .rank-name {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.rank-table .rank-list {
  color: #64748b;
  font-size: 12px;
}

.rank-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.12);
}

/* 受注数：落ち着いた暖色（煉瓦〜ダスティローズ） */
.rank-table--acq thead th {
  background: var(--rank-acq-ink);
  color: #fff;
  border-bottom: 1px solid var(--color-border);
}

.rank-table--acq tr.rank-row--p1 {
  background: var(--rank-acq-mid);
  color: #fff;
  height: 64px;
}

.rank-table--acq tr.rank-row--p1 td {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.rank-table--acq tr.rank-row--p1 .rank-no,
.rank-table--acq tr.rank-row--p1 .rank-name {
  color: #fff;
}

.rank-table--acq tr.rank-row--p2,
.rank-table--acq tr.rank-row--p3 {
  background: var(--rank-acq-soft);
  color: var(--color-text);
  height: 44px;
}

.rank-table--acq tr.rank-row--p2 td,
.rank-table--acq tr.rank-row--p3 td {
  font-size: 16px;
  font-weight: 800;
}

.rank-table--acq tr.rank-row--top10 {
  background: var(--rank-acq-wash);
}

.rank-table--acq tr.rank-row--rest:nth-child(even) {
  background: #fafaf9;
}

/* 平均値：落ち着いた寒色（スレートティール） */
.rank-table--avg thead th {
  background: var(--rank-avg-ink);
  color: #fff;
  border-bottom: 1px solid var(--color-border);
}

.rank-table--avg tr.rank-row--p1 {
  background: var(--rank-avg-mid);
  color: #fff;
  height: 64px;
}

.rank-table--avg tr.rank-row--p1 td {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.rank-table--avg tr.rank-row--p1 .rank-no,
.rank-table--avg tr.rank-row--p1 .rank-name {
  color: #fff;
}

.rank-table--avg tr.rank-row--p2,
.rank-table--avg tr.rank-row--p3 {
  background: var(--rank-avg-soft);
  color: var(--color-text);
  height: 44px;
}

.rank-table--avg tr.rank-row--p2 td,
.rank-table--avg tr.rank-row--p3 td {
  font-size: 16px;
  font-weight: 800;
}

.rank-table--avg tr.rank-row--top10 {
  background: var(--rank-avg-wash);
}

.rank-table--avg tr.rank-row--below {
  background: var(--rank-below) !important;
  color: #7f1d1d;
}

.rank-table--avg tr.rank-row--below:hover {
  background: #e0c8c8 !important;
}

.rank-table--avg tr.rank-row--rest:not(.rank-row--below):nth-child(even) {
  background: #f7faf9;
}

/* KDI */
.rank-table--kdi thead th {
  background: #475569;
  color: #fff;
  border-bottom: 2px solid #1e293b;
}

.rank-table--kdi tr.rank-row--p1 {
  background: #94a3b8;
  height: 56px;
}

.rank-table--kdi tr.rank-row--p1 td {
  font-size: 22px;
  font-weight: 800;
}

.rank-table--kdi tr.rank-row--p2,
.rank-table--kdi tr.rank-row--p3 {
  background: #cbd5e1;
  height: 42px;
}

.rank-table--kdi tr.rank-row--p2 td,
.rank-table--kdi tr.rank-row--p3 td {
  font-size: 16px;
  font-weight: 800;
}

.rank-table--kdi tr.rank-row--top10 {
  background: #e2e8f0;
}

.rank-table--kdi tr.rank-row--below {
  background: #fecaca !important;
}

.rank-table .rank-no {
  width: 52px;
  font-weight: 800;
}

.rank-table .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rank-flash-grid {
  margin-bottom: 8px;
}

.rank-flash-grid.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.rank-flash-grid .stat-card {
  padding: 8px 10px;
}

.rank-flash-grid .stat-card__value {
  font-size: 20px;
}

.rank-flash-target {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.rank-flash-time {
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* 受注速報: 達成率帯 / 実績帯を分け、コード別に並べる */
.flash-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.flash-board__block {
  border: 1px solid var(--color-border, #1a1a1a);
  background: #fff;
}

.flash-board__title {
  margin: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-border, #1a1a1a);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--color-paper, #f4f1ea);
}

.flash-board__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flash-board__cell {
  padding: 14px 16px;
  border-right: 1px solid var(--color-border, #d6d0c4);
}

.flash-board__cell:last-child {
  border-right: 0;
}

.flash-board__code {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--color-text, #1a1a1a);
}

.flash-board__cell--primary .flash-board__code,
.flash-board__cell--primary .flash-board__actual {
  color: var(--color-primary, #1d4ed8);
}

.flash-board__cell--accent .flash-board__code,
.flash-board__cell--accent .flash-board__actual {
  color: var(--color-accent, #b45309);
}

.flash-board__value {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.flash-board__value--rate {
  font-size: 40px;
}

.flash-board__value--rate.is-ok {
  color: #2f6b4f;
}

.flash-board__value--rate.is-low {
  color: #8b3a3a;
}

.flash-board__unit {
  font-size: 20px;
  margin-left: 2px;
  font-weight: 700;
}

.flash-board__value--count {
  font-size: 32px;
}

.flash-board__sep,
.flash-board__target {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-muted, #666);
}

.flash-acq-card .card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.flash-acq-table th,
.flash-acq-table td {
  font-size: 15px;
  padding: 8px 10px;
}

.flash-acq__name {
  font-weight: 700;
}

.flash-acq__code {
  font-weight: 700;
  font-size: 16px;
}

.flash-acq__cnt {
  font-size: 18px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .flash-board__cols {
    grid-template-columns: 1fr;
  }

  .flash-board__cell {
    border-right: 0;
    border-bottom: 1px solid var(--color-border, #d6d0c4);
  }

  .flash-board__cell:last-child {
    border-bottom: 0;
  }

  .flash-board__value--rate {
    font-size: 34px;
  }

  .flash-board__value--count {
    font-size: 28px;
  }
}


.rank-note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.rank-snap-list {
  margin: 0;
  padding-left: 20px;
}

/* --- ロードマップ --- */
.rm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rm-month-form label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.rm-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rm-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fafafa;
}

.rm-summary-card__title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 14px;
}

.rm-summary-card__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 6px;
}

.rm-summary-card__label {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
}

.rm-summary-card strong {
  font-size: 20px;
}

.rm-table-wrap,
.page-roadmap .card__body.table-wrap {
  max-height: min(70vh, 640px);
  overflow: auto;
  border: 1px solid var(--color-border, #111827);
  border-radius: 0;
}

.page-roadmap .card__body.table-wrap {
  padding: 0;
}

.rm-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1100px;
  table-layout: auto;
}

.rm-table th,
.rm-table td {
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
  text-align: center !important;
  padding: 6px 8px;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
}

.rm-table th:nth-child(1),
.rm-table th:nth-child(2),
.rm-table td:nth-child(1),
.rm-table td:nth-child(2) {
  text-align: center !important;
}

.rm-table th:nth-child(1),
.rm-table td:nth-child(1) {
  width: auto;
  min-width: 3.5em;
}

.rm-table th:nth-child(2),
.rm-table td:nth-child(2) {
  width: auto;
  min-width: 2.2em;
}

/* sticky は重なりやすいのでヘッダーは通常表示 + 濃色で視認性確保 */
.rm-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-text) !important;
  color: #fff !important;
  font-weight: 800;
  border-bottom: 1px solid #fff;
  box-shadow: none;
}

.rm-table thead tr:first-child th {
  top: 0;
  z-index: 3;
}

.rm-table thead tr:nth-child(2) th {
  top: 2.2em;
  z-index: 2;
}

/* コード区分（62 / 61 / 合計 / 平均）の境目罫線 */
.rm-table tbody td:nth-child(3),
.rm-table tbody td:nth-child(8),
.rm-table tbody td:nth-child(13),
.rm-table tbody td:nth-child(16),
.rm-table .rm-edge--chokuei,
.rm-table .rm-edge--kotaku,
.rm-table .rm-edge--total,
.rm-table .rm-edge--avg {
  border-left: 2px solid var(--color-border, #111827) !important;
}

.rm-table thead .rm-edge--chokuei,
.rm-table thead .rm-edge--kotaku,
.rm-table thead .rm-edge--total,
.rm-table thead .rm-edge--avg {
  border-left: 2px solid #fff !important;
}

.rm-table thead .rm-group-head--chokuei {
  background: #1e3a8a !important;
}

/* 62→61 の境目を特に強調 */
.rm-table tbody td:nth-child(8),
.rm-table .rm-edge--kotaku {
  border-left: 3px solid var(--color-border, #111827) !important;
}

.rm-table thead .rm-edge--kotaku {
  border-left: 3px solid #fff !important;
}

/* 直営(62)=薄青 / 固託(61)=薄緑 / 合計=薄黄 */
.rm-table tbody td:nth-child(n + 3):nth-child(-n + 7) {
  background-color: #f8fafc;
}

.rm-table tbody td:nth-child(n + 8):nth-child(-n + 12) {
  background-color: #f0fdfa;
}

.rm-table tbody td:nth-child(n + 13):nth-child(-n + 15) {
  background-color: #fffbeb;
}

.rm-table tbody tr.rm-row--today td:nth-child(n + 3):nth-child(-n + 7) {
  background-color: #e0e7ff !important;
}

.rm-table tbody tr.rm-row--today td:nth-child(n + 8):nth-child(-n + 12) {
  background-color: #ccfbf1 !important;
}

.rm-table tbody tr.rm-row--today td:nth-child(n + 13):nth-child(-n + 15) {
  background-color: #fef3c7 !important;
}

.rm-table tbody tr.rm-row--future td:nth-child(n + 3):nth-child(-n + 7),
.rm-table tbody tr.rm-row--future td:nth-child(n + 8):nth-child(-n + 12),
.rm-table tbody tr.rm-row--future td:nth-child(n + 13):nth-child(-n + 15) {
  opacity: 0.85;
}

.rm-table tbody td {
  color: var(--color-text, #111827);
  background: #fff;
}

.rm-row--today td {
  background: #eef2ff !important;
}

.rm-row--future td {
  color: var(--color-text-muted, #4b5563);
  background: #f8f7f4 !important;
}

.rm-summary-card {
  border: 1px solid var(--color-border, #111827) !important;
  border-radius: 0 !important;
  background: #fff !important;
}

.rm-summary-card__title {
  color: var(--color-text, #111827);
}

.rm-summary-card__label {
  color: var(--color-text-muted, #4b5563);
}

.rm-summary-card strong {
  color: var(--color-text, #111827);
}

.badge--ok {
  background: #d1fae5;
  color: #065f46;
}

@media (max-width: 1100px) {
  .rm-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .rank-dual {
    grid-template-columns: 1fr;
  }
}

/* アカウント発行フォーム */
.acct-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.acct-form__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.acct-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-weight: 500;
  min-width: 0;
}

.acct-form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.acct-form__req {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
}

.acct-form__field input,
.acct-form__field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}

.acct-form__field input:focus,
.acct-form__field select:focus {
  outline: 2px solid rgba(13, 148, 136, 0.25);
  border-color: var(--color-accent, #0d9488);
}

.acct-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}

.acct-form__help {
  margin: 0;
  flex: 1 1 240px;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.acct-form--csv .acct-form__field {
  max-width: 420px;
}

@media (max-width: 900px) {
  .acct-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .acct-form__grid {
    grid-template-columns: 1fr;
  }
}

.acct-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.acct-bulk-bar__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  cursor: pointer;
}

.acct-check {
  text-align: center;
  vertical-align: middle;
}

.acct-issued-fold {
  padding: 0;
  overflow: hidden;
}

.acct-issued-fold__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
}

.acct-issued-fold__summary::-webkit-details-marker {
  display: none;
}

.acct-issued-fold__summary::before {
  content: "▶ ";
  color: inherit;
  font-size: 11px;
}

.acct-issued-fold[open] > .acct-issued-fold__summary::before {
  content: "▼ ";
}

.acct-issued-fold__body {
  padding: 0 16px 14px;
  border-top: 1px solid rgba(22, 101, 52, 0.2);
}

.acct-sort-th {
  white-space: nowrap;
}

.acct-sort {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
}

.acct-sort:hover,
.acct-sort.is-active {
  color: var(--color-accent, #0d9488);
  text-decoration: underline;
}

.acct-sort__mark {
  font-size: 10px;
  margin-left: 2px;
  display: inline-block;
  min-width: 0.9em;
}

/* ===== Team compact fold list ===== */
.team-mine-label {
  margin: 0 0 12px;
  font-size: 14px;
}
.team-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.team-list__section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.team-list__head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}
.team-fold {
  border-bottom: 1px solid var(--color-border);
}
.team-fold:last-child {
  border-bottom: none;
}
.team-fold--mine > .team-fold__summary {
  background: #ecfeff;
}
.team-fold__summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 90px minmax(120px, 1.6fr);
  gap: 8px;
  align-items: center;
  padding: 8px 12px 8px 28px;
  min-height: 36px;
  font-size: 13px;
  position: relative;
}
.team-fold__summary::-webkit-details-marker { display: none; }
.team-fold__summary::before {
  content: "▶";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 10px;
}
.team-fold[open] > .team-fold__summary::before { content: "▼"; }
.team-fold__summary:hover { background: var(--color-surface-muted); }
.team-fold__name { font-weight: 700; }
.team-fold__meta,
.team-fold__leaders {
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-fold__body {
  padding: 0 12px 12px;
  background: #fafbfc;
  border-top: 1px dashed var(--color-border);
}
.team-fold__warn {
  margin: 8px 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #991b1b;
  background: #fef2f2;
  border-radius: 8px;
}
.team-fold__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.team-fold__table th,
.team-fold__table td {
  padding: 2px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}
.team-fold__table th {
  background: var(--color-surface-muted);
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 4px 8px;
}
.team-fold__table tr:last-child td { border-bottom: none; }
.team-fold__table tr.is-me { background: #f0fdfa; }
.team-fold__you {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  margin-left: 4px;
}
.team-fold__ops { white-space: nowrap; }
.team-fold__admin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .team-fold__summary {
    grid-template-columns: 1fr auto;
  }
  .team-fold__leaders { grid-column: 1 / -1; }
}

/* ===== Fold open: color separation (no heavy borders) ===== */
.team-fold[open],
.ann-sheet__item[open],
.ann-fold[open],
.acct-issued-fold[open],
.master-details[open] {
  margin: 8px 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #e0f2fe;
  overflow: hidden;
}
.team-fold[open] {
  border-bottom: none;
}
.team-list__section .team-fold[open] + .team-fold,
.ann-sheet .ann-sheet__item[open] + .ann-sheet__item {
  margin-top: 0;
}
.team-fold[open] > .team-fold__summary,
.ann-sheet__item[open] > .ann-sheet__row {
  background: #bae6fd;
  border-bottom: none;
  font-weight: 700;
}
.team-fold[open] > .team-fold__body,
.ann-sheet__item[open] > .ann-sheet__detail {
  background: #e0f2fe;
  border-top: none;
  padding-bottom: 14px;
}
.team-fold[open] .team-fold__table {
  border: none;
  box-shadow: none;
  background: #fff;
}
.ann-fold[open] > .ann-fold__summary,
.acct-issued-fold[open] > .acct-issued-fold__summary,
.master-details[open] > .master-summary {
  border-bottom: none;
  background: #bae6fd;
}
.ann-fold[open] > .ann-fold__body,
.acct-issued-fold[open] > .acct-issued-fold__body {
  background: #e0f2fe;
}

.profile-kv-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
}
.profile-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.profile-kv:last-of-type {
  border-bottom: none;
}
.profile-kv span {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}
.profile-kv b {
  font-weight: 600;
}

/* スプレッドシート方式フォーム（項目|値）— 外枠＋横線のみ。入力の二重枠は禁止 */
.sheet-card {
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.sheet-card .card__header {
  display: none;
}
.sheet-card__body {
  padding: 0 !important;
}
.sheet-form {
  margin: 0;
}
.sheet-form__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 0;
}
.sheet-form__table th,
.sheet-form__table td {
  border: 0;
  border-bottom: 1px solid #d6d3d1;
  padding: 0;
  vertical-align: middle;
  line-height: 1.35;
}
.sheet-form__table tr:last-child th,
.sheet-form__table tr:last-child td {
  border-bottom: 0;
}
.sheet-form__table th {
  width: 112px;
  background: #f5f3ef;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  padding: 7px 10px;
  border-right: 1px solid #e7e5e4;
}
.sheet-form__table td {
  background: #fff;
  padding: 0 2px 0 0;
}
.sheet-form__table td:has(> :not(input):not(select)),
.sheet-form__table td.sheet-form__plain {
  padding: 7px 10px;
}
.sheet-form__table input,
.sheet-form__table select {
  width: 100%;
  max-width: none;
  min-height: 34px;
  height: 34px;
  padding: 4px 10px;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  background: transparent;
  box-shadow: none !important;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.sheet-form__table select {
  background-image: linear-gradient(45deg, transparent 50%, #78716c 50%),
    linear-gradient(135deg, #78716c 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.sheet-form__table input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}
.sheet-form__table input:focus,
.sheet-form__table select:focus {
  outline: none;
  background: #f0f7ff;
  box-shadow: none !important;
  border: 0 !important;
}
.sheet-form__table input::placeholder {
  color: #a8a29e;
}
.sheet-form__inline {
  margin: 0;
  display: block;
}
.sheet-form__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #d6d3d1;
  background: #fafaf9;
}
.sheet-form__note {
  margin: 0;
  padding: 6px 10px 8px;
  font-size: 11px;
  color: #78716c;
  line-height: 1.4;
  border: 0;
  border-top: 1px solid #e7e5e4;
  background: transparent;
}
.sheet-form__note a {
  font-weight: 700;
}

.profile-form label {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text);
}
.profile-form label:last-of-type {
  border-bottom: 0;
}
.profile-form input,
.profile-form select {
  font-weight: 500;
  color: var(--color-text);
  min-height: 28px;
  height: 28px;
  padding: 2px 8px;
  border-radius: 0;
}
.profile-select {
  margin-bottom: 0;
}

/* ========== Swiss Ops cascade (hardcoded radius / soft UI) ========== */
.sidebar__brand,
.topbar__menu,
.alert,
.modal,
.toast,
.shiftcal__cell,
.emp-search__input,
.ann-sheet,
.rm-summary-card,
.rank-flash-grid .stat-card {
  border-radius: 0 !important;
}

.card,
.dash-block,
.dash-stack,
.dash-metric,
.stat-card,
.table-wrap,
.btn,
.btn--sm,
.btn--lg,
.form__input,
.form__select,
.form__textarea,
.badge,
.user-chip,
.auth-card,
.rank-sheet {
  border-radius: 0;
  box-shadow: none;
}

.rank-flash-grid.stat-grid {
  gap: 0;
  border: 1px solid var(--color-border);
}

.rank-flash-grid .stat-card {
  border-right: 1px solid var(--color-border);
}

.rank-flash-grid .stat-card:last-child {
  border-right: 0;
}

.dash-metrics--stacks {
  gap: 0;
}

.dash-stack {
  border-radius: 0;
  box-shadow: none;
  border: 0;
}

.dash-metrics--stacks .dash-stack + .dash-stack {
  border-left: 0;
}

/* ===== Messages · LINE Soft Green (peer threads) ===== */
.page-messages .main-content {
  --msg-green: #06c755;
  --msg-green-soft: #e8f9ee;
  --msg-green-deep: #05b34c;
  --msg-chat-bg: #8aa4c8;
}

.msg-shell {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.msg-top {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  font-weight: 800;
  background: #fff;
}

.msg-top__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-top__label {
  font-size: 13px;
  font-weight: 800;
}

.msg-btn-new {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: var(--msg-green, #06c755);
  color: #fff !important;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.msg-btn-new:hover {
  background: var(--msg-green-deep, #05b34c);
  color: #fff !important;
}

.msg-thread__peer {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}

.msg-title-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.msg-title-input {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  min-width: min(240px, 70vw);
  background: #fff;
}

.msg-chat__head-main {
  min-width: 0;
  flex: 1;
}

.msg-split {
  display: grid;
  grid-template-columns: minmax(240px, 34%) 1fr;
  min-height: calc(100vh - 180px);
  background: #fff;
}

.msg-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.msg-pane--list {
  border-right: 1px solid #e5e7eb;
  background: #fff;
}

.msg-pane--detail {
  background: #f8fafc;
  min-height: 360px;
}

.msg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.msg-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  text-decoration: none;
}

.msg-chip:hover {
  color: #0f172a;
}

.msg-chip.is-active {
  background: var(--msg-green, #06c755);
  color: #fff;
}

.msg-threads {
  flex: 1;
  overflow: auto;
}

.msg-thread {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: inherit;
  text-decoration: none;
}

.msg-thread:hover {
  background: #f8fafc;
}

.msg-thread.is-active {
  background: var(--msg-green-soft, #e8f9ee);
  box-shadow: inset 3px 0 0 var(--msg-green, #06c755);
}

.msg-thread.is-unread .msg-thread__who {
  font-weight: 800;
}

.msg-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1e3a8a;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.msg-thread__who {
  font-size: 13px;
  font-weight: 700;
}

.msg-thread__preview {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-thread__marks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.msg-thread__meta {
  text-align: right;
  font-size: 10px;
  color: #94a3b8;
}

.msg-ucount {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--msg-green, #06c755);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.msg-mark {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
}

.msg-mark--t {
  background: #ffe4e6;
  color: #9f1239;
}

.msg-mark--b {
  background: #fff7ed;
  color: #c2410c;
}

.msg-empty-l {
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.msg-detail-empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
  min-height: 320px;
  background:
    radial-gradient(circle at 20% 20%, rgba(6, 199, 85, 0.06) 0 2px, transparent 3px),
    #f8fafc;
}

.msg-detail-empty strong {
  display: block;
  color: #111827;
  margin-bottom: 6px;
  font-size: 14px;
}

.msg-chat {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--msg-chat-bg, #8aa4c8);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.06) 0 2px, transparent 3px);
}

.msg-chat__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.msg-chat__name {
  font-size: 14px;
  font-weight: 800;
}

.msg-chat__sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.msg-back {
  display: none;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.msg-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.msg-ghost {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  color: #475569;
  cursor: pointer;
  min-height: 32px;
}

.msg-ghost.is-on {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.msg-feed {
  flex: 1;
  padding: 14px 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: calc(100vh - 320px);
}

.msg-day {
  align-self: center;
  background: rgba(15, 23, 42, 0.32);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 4px 0 8px;
}

.msg-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  max-width: 86%;
}

.msg-row.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bubble {
  padding: 8px 11px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-row.me .msg-bubble {
  background: var(--msg-green, #06c755);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-row.them .msg-bubble {
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  margin-bottom: 2px;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.25);
}

.msg-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.msg-compose textarea {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  width: 100%;
}

.msg-send {
  border: 0;
  background: var(--msg-green, #06c755);
  color: #fff;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  min-width: 72px;
}

.msg-send:hover {
  background: var(--msg-green-deep, #05b34c);
}

.msg-new {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f8fafc;
  min-height: 360px;
}

.msg-new__box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

.msg-new__box h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.msg-new__box p {
  margin: 0 0 12px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.msg-new__box label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 4px;
}

.msg-new__box .form__input,
.msg-new__box .form__textarea {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 12px;
}

.msg-new__box .msg-send {
  width: 100%;
  height: 40px;
}

.msg-shell.is-new .msg-chat {
  display: none;
}

@media (max-width: 860px) {
  .msg-split {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 160px);
  }

  .msg-pane--list {
    border-right: 0;
  }

  .msg-shell:not(.is-detail) .msg-pane--detail {
    display: none;
  }

  .msg-shell.is-detail .msg-pane--list {
    display: none;
  }

  .msg-back {
    display: inline-block;
  }

  .msg-chat__head {
    flex-direction: column;
  }

  .msg-tools {
    justify-content: flex-start;
  }

  .msg-feed {
    max-height: none;
  }
}

