:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --line: #d9e2f0;
  --line-strong: #b8c6dc;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --max-width: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Noto Sans JP", "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

img {
  max-width: 100%;
  height: auto;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #0f172a;
  color: #e5e7eb;
  padding: 20px 16px;
  border-right: 1px solid #111827;
  position: fixed;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar h1,
.sidebar h2,
.sidebar h3 {
  color: #fff;
  margin-top: 0;
}

.sidebar .brand {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.sidebar .nav-group {
  margin-bottom: 18px;
}

.sidebar .nav-title {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar a,
.sidebar button,
.sidebar .nav-link {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #e5e7eb;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

.sidebar a:hover,
.sidebar button:hover,
.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.sidebar .active {
  background: rgba(37, 99, 235, 0.24);
  color: #fff;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 22px;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.card,
.panel,
.section-card,
.auth-card,
.table-card,
.stat-card,
.filter-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card,
.panel,
.section-card,
.table-card,
.filter-card {
  padding: 18px;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 18px;
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-card .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.kpi-success {
  border-left: 5px solid var(--success);
}

.kpi-warning {
  border-left: 5px solid var(--warning);
}

.kpi-danger {
  border-left: 5px solid var(--danger);
}

.kpi-info {
  border-left: 5px solid var(--info);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid label,
.field {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input[readonly],
textarea[readonly] {
  background: #f8fafc;
}

.checkbox-row,
.inline-checks,
.inline-actions,
.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.checkbox-row label,
.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

button,
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.04s ease, background 0.15s ease, border-color 0.15s ease;
  background: #e5e7eb;
  color: #111827;
}

button:hover,
.btn:hover {
  filter: brightness(0.98);
  text-decoration: none;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary,
button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover,
button[type="submit"]:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  vertical-align: top;
  text-align: left;
  font-size: 0.93rem;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0.01em;
  position: fixed;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: #fafcff;
}

td.actions,
th.actions {
  white-space: nowrap;
}

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-success,
.status-active,
.status-running {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.18);
}

.badge-warning,
.status-pending,
.status-preparing {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.18);
}

.badge-danger,
.status-stopped,
.status-error,
.status-inactive {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.18);
}

.badge-info,
.status-done {
  background: rgba(8, 145, 178, 0.12);
  color: #155e75;
  border-color: rgba(8, 145, 178, 0.18);
}

.muted,
.help,
.hint,
.small {
  color: var(--muted);
  font-size: 0.88rem;
}

.help-box,
.hint-box,
.notice-box {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.flash-wrap {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash,
.alert {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.flash-success,
.alert-success {
  background: rgba(22, 163, 74, 0.10);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.22);
}

.flash-error,
.alert-error,
.flash-danger,
.alert-danger {
  background: rgba(220, 38, 38, 0.10);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.22);
}

.flash-warning,
.alert-warning {
  background: rgba(217, 119, 6, 0.10);
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.22);
}

.flash-info,
.alert-info {
  background: rgba(8, 145, 178, 0.10);
  color: #155e75;
  border-color: rgba(8, 145, 178, 0.22);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 24px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.auth-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--text);
}

.tab-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.definition-list,
.meta-list {
  display: grid;
  gap: 10px;
}

.definition-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.definition-item:last-child {
  border-bottom: 70px;
}

.definition-item .key {
  color: var(--muted);
  font-weight: 700;
}

.definition-item .value {
  min-width: 0;
  word-break: break-word;
}

.progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.copy-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.copy-row textarea,
.copy-row input[type="text"] {
  flex: 1 1 420px;
}

.debug-outline .card,
.debug-outline .panel,
.debug-outline .section-card,
.debug-outline .table-wrap,
.debug-outline .stat-card,
.debug-outline form,
.debug-outline table {
  outline: 1px dashed rgba(37, 99, 235, 0.25);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.hidden {
  display: none !important;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.w-full {
  width: 100%;
}

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 70px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 220px 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #111827;
  }

  .main {
    padding: 14px;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .definition-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  table {
    min-width: 760px;
  }
}

@media (max-width: 540px) {
  html {
    font-size: 15px;
  }

  .main {
    padding: 10px;
  }

  .card,
  .panel,
  .section-card,
  .table-card,
  .filter-card,
  .stat-card,
  .auth-card {
    padding: 14px;
    border-radius: 12px;
  }

  button,
  .btn {
    width: 100%;
  }

  .action-row,
  .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Header / Footer layout override
======================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: #0f172a;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  position: fixed;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand-area {
  min-width: 0;
}

.site-brand {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  text-decoration: none;
}

.site-brand:hover {
  text-decoration: none;
}

.site-subtext {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

.site-user-name {
  font-weight: 800;
  color: #0f172a;
}

.site-user-role {
  font-size: 0.82rem;
  color: var(--muted);
}

.btn-logout {
  white-space: nowrap;
}

.header-nav-wrap {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.header-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.quick-nav-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  text-decoration: none;
}

.menu-drawer {
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.menu-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 800;
  color: #0f172a;
  user-select: none;
}

.menu-drawer summary::-webkit-details-marker {
  display: none;
}

.menu-drawer[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.menu-drawer-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.menu-drawer-group {
  display: grid;
  gap: 8px;
}

.menu-drawer-title {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 800;
}

.menu-drawer-group a {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid transparent;
  text-decoration: none;
}

.menu-drawer-group a:hover {
  background: #f8fafc;
  border-color: var(--line);
  text-decoration: none;
}

.main {
  min-width: 0;
  flex: 1 1 auto;
  padding: 24px 22px 32px;
}

.site-footer {
  margin-top: auto;
  background: #0f172a;
  color: #e5e7eb;
  border-top: 1px solid #111827;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-brand {
  font-weight: 800;
  color: #fff;
}

.site-footer-text {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.footer-nav a {
  color: #cbd5e1;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #fff;
  text-decoration: none;
}

@media (max-width: 820px) {
  .site-header-inner,
  .header-nav-inner,
  .site-footer-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .main {
    padding: 16px 14px 24px;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .quick-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .quick-nav-link {
    white-space: nowrap;
  }

  .menu-drawer {
    width: 100%;
  }

  .footer-nav {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .site-brand {
    font-size: 1.15rem;
  }

  .site-header-right {
    display: grid;
    grid-template-columns: 1fr;
  }

  .site-user-chip {
    border-radius: 12px;
  }

  .btn-logout {
    width: 100%;
  }
}

/* ==== fix: header visibility ==== */
.site-header {
  background: #0f172a !important;
  color: #fff !important;
}

.site-brand {
  color: #fff !important;
}

.site-subtext {
  color: #94a3b8 !important;
}

.quick-nav-link {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border: none !important;
}

.quick-nav-link:hover {
  background: rgba(255,255,255,0.16) !important;
}

.menu-drawer {
  background: #1e293b !important;
  color: #fff !important;
}

.menu-drawer-group a {
  color: #e5e7eb !important;
}

.menu-drawer-group a:hover {
  background: rgba(255,255,255,0.08) !important;
}

/* ========================================
   final fix: header / footer visibility
======================================== */

.site-header,
.header-nav-wrap,
.site-footer {
  color: #e5e7eb !important;
}

.site-header {
  background: #0f172a !important;
  border-bottom: 1px solid #1f2937 !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22) !important;
}

.site-header-inner,
.header-nav-inner,
.site-footer-inner {
  background: transparent !important;
}

.site-brand,
.site-brand:hover {
  color: #ffffff !important;
}

.site-subtext {
  color: #94a3b8 !important;
}

.site-user-chip {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.site-user-name {
  color: #ffffff !important;
}

.site-user-role {
  color: #cbd5e1 !important;
}

.btn-logout,
.btn-logout:hover {
  background: transparent !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  text-decoration: none !important;
}

.header-nav-wrap {
  background: #111827 !important;
  border-bottom: 1px solid #1f2937 !important;
}

.quick-nav-link,
.quick-nav-link:hover,
.quick-nav-link:visited {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  text-decoration: none !important;
}

.quick-nav-link:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

.menu-drawer {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #ffffff !important;
}

.menu-drawer summary {
  background: #1e293b !important;
  color: #ffffff !important;
}

.menu-drawer[open] summary {
  background: #0f172a !important;
  border-bottom: 1px solid #334155 !important;
}

.menu-drawer-title {
  color: #94a3b8 !important;
}

.menu-drawer-group a,
.menu-drawer-group a:visited {
  background: transparent !important;
  color: #e5e7eb !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
}

.menu-drawer-group a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.site-footer {
  background: #0f172a !important;
  border-top: 1px solid #1f2937 !important;
}

.site-footer-brand {
  color: #ffffff !important;
}

.site-footer-text {
  color: #94a3b8 !important;
}

.footer-nav a,
.footer-nav a:visited {
  color: #cbd5e1 !important;
  text-decoration: none !important;
}

.footer-nav a:hover {
  color: #ffffff !important;
}

.main {
  background: var(--bg) !important;
}

.page {
  color: var(--text) !important;
}

@media (max-width: 820px) {
  .site-header {
    position: static !important;
  }
}

/* ========================================
   compact fixed header / footer
======================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid #1f2937;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.topbar-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand {
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none !important;
  white-space: nowrap;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  font-size: 0.82rem;
  white-space: nowrap;
}

.topbar-user-name {
  font-weight: 800;
}

.topbar-user-role {
  color: #cbd5e1;
}

.topbar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-logout:hover {
  background: rgba(255,255,255,0.08);
}

.topbar-menu {
  position: relative;
}

.topbar-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.topbar-menu summary::-webkit-details-marker {
  display: none;
}

.topbar-menu-panel {
  position: absolute;
  top: 44px;
  right: 0;
  width: 220px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.topbar-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #e5e7eb !important;
  text-decoration: none !important;
  font-size: 0.9rem;
}

.topbar-menu-panel a:hover {
  background: rgba(255,255,255,0.08);
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 70px;
  height: 58px;
  background: #0f172a;
  border-top: 1px solid #1f2937;
  z-index: 1000;
}

.bottombar-nav {
  max-width: 760px;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.bottombar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  padding: 0 4px;
}

.bottombar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff !important;
}

.main-fixed-nav {
  padding-top: 76px !important;
  padding-bottom: 76px !important;
}

@media (max-width: 820px) {
  .topbar {
    height: 56px;
  }

  .topbar-inner {
    padding: 0 10px;
    gap: 8px;
  }

  .topbar-brand {
    font-size: 0.94rem;
  }

  .topbar-user {
    display: none;
  }

  .topbar-menu-panel {
    width: min(220px, calc(100vw - 20px));
    right: 0;
  }

  .main-fixed-nav {
    padding-top: 68px !important;
    padding-bottom: 70px !important;
  }

  .bottombar {
    height: 54px;
  }

  .bottombar-nav a {
    font-size: 0.74rem;
  }
}

@media (max-width: 540px) {
  .topbar-logout {
    display: none;
  }

  .topbar-brand {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bottombar-nav {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ==== force disable old large nav ==== */
.site-header,
.header-nav-wrap,
.site-footer,
.sidebar,
.quick-nav,
.menu-drawer,
.site-header-inner,
.header-nav-inner {
  display: none !important;
}

/* ==== force compact fixed layout ==== */
.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 56px !important;
  background: #0f172a !important;
  border-bottom: 1px solid #1f2937 !important;
  z-index: 9999 !important;
  display: block !important;
}

.topbar-inner {
  max-width: 1440px !important;
  height: 56px !important;
  margin: 0 auto !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.topbar-left,
.topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.topbar-brand {
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.topbar-menu {
  position: relative !important;
  display: inline-block !important;
}

.topbar-menu summary {
  list-style: none !important;
  height: 34px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.topbar-menu summary::-webkit-details-marker {
  display: none !important;
}

.topbar-menu-panel {
  position: absolute !important;
  top: 40px !important;
  right: 0 !important;
  width: 220px !important;
  padding: 8px !important;
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 24px rgba(15,23,42,0.28) !important;
  display: grid !important;
  gap: 4px !important;
}

.topbar-menu-panel a {
  display: block !important;
  padding: 9px 10px !important;
  color: #e5e7eb !important;
  text-decoration: none !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}

.topbar-menu-panel a:hover {
  background: rgba(255,255,255,0.08) !important;
}

.topbar-user {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

.topbar-logout {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 8px !important;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.bottombar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 52px !important;
  background: #0f172a !important;
  border-top: 1px solid #1f2937 !important;
  z-index: 9999 !important;
  display: block !important;
}

.bottombar-nav {
  max-width: 760px !important;
  height: 52px !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  align-items: center !important;
}

.bottombar-nav a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-align: center !important;
  padding: 0 4px !important;
}

.bottombar-nav a:hover {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

.main.main-fixed-nav {
  padding-top: 72px !important;
  padding-bottom: 68px !important;
}

@media (max-width: 820px) {
  .topbar-user,
  .topbar-logout {
    display: none !important;
  }

  .topbar-brand {
    font-size: 14px !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .main.main-fixed-nav {
    padding-top: 68px !important;
    padding-bottom: 64px !important;
  }

  .bottombar-nav a {
    font-size: 11px !important;
  }
}

/* ========================================
   final visible fixed header / footer
======================================== */

.topbar,
.bottombar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 56px !important;
  background: #0f172a !important;
  border-bottom: 1px solid #1f2937 !important;
  z-index: 99999 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18) !important;
}

.topbar-inner {
  max-width: 1440px !important;
  height: 56px !important;
  margin: 0 auto !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.topbar-brand {
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.topbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.topbar-user {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.08) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

.topbar-user-name {
  font-weight: 800 !important;
  color: #ffffff !important;
}

.topbar-user-role {
  color: #cbd5e1 !important;
}

.topbar-logout {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.topbar-menu {
  position: relative !important;
  display: inline-block !important;
}

.topbar-menu summary {
  list-style: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.08) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  user-select: none !important;
}

.topbar-menu summary::-webkit-details-marker {
  display: none !important;
}

.topbar-menu-panel {
  position: absolute !important;
  top: 40px !important;
  right: 0 !important;
  width: 220px !important;
  padding: 8px !important;
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 24px rgba(15,23,42,0.28) !important;
  display: grid !important;
  gap: 4px !important;
}

.topbar-menu-panel a {
  display: block !important;
  padding: 9px 10px !important;
  color: #e5e7eb !important;
  text-decoration: none !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}

.topbar-menu-panel a:hover {
  background: rgba(255,255,255,0.08) !important;
}

.bottombar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 52px !important;
  background: #0f172a !important;
  border-top: 1px solid #1f2937 !important;
  z-index: 99999 !important;
}

.bottombar-nav {
  max-width: 760px !important;
  height: 52px !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  align-items: center !important;
}

.bottombar-nav a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-align: center !important;
  padding: 0 4px !important;
}

.bottombar-nav a:hover {
  background: rgba(255,255,255,0.08) !important;
  color: #ffffff !important;
}

.main.main-fixed-nav {
  padding-top: 72px !important;
  padding-bottom: 68px !important;
}

@media (max-width: 820px) {
  .topbar-user,
  .topbar-logout {
    display: none !important;
  }

  .topbar-brand {
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .bottombar-nav a {
    font-size: 11px !important;
  }

  .main.main-fixed-nav {
    padding-top: 68px !important;
    padding-bottom: 64px !important;
  }
}

/* ===== clean fixed header / footer ===== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #0f172a;
  border-bottom: 1px solid #1f2937;
  z-index: 9999;
}

.topbar-inner {
  max-width: 1440px;
  height: 56px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.topbar-menu {
  position: relative;
}

.topbar-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.topbar-menu summary::-webkit-details-marker {
  display: none;
}

.topbar-menu-panel {
  position: absolute;
  top: 40px;
  right: 0;
  width: 220px;
  padding: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.28);
}

.topbar-menu-panel a {
  display: block;
  padding: 9px 10px;
  color: #e5e7eb;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
}

.topbar-menu-panel a:hover {
  background: rgba(255,255,255,0.08);
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 70px;
  height: 52px;
  background: #0f172a;
  border-top: 1px solid #1f2937;
  z-index: 9999;
}

.bottombar-nav {
  max-width: 760px;
  height: 52px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.bottombar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.bottombar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.main-fixed-nav {
  padding-top: 72px;
  padding-bottom: 68px;
}

@media (max-width: 820px) {
  .main-fixed-nav {
    padding-top: 68px;
    padding-bottom: 64px;
  }

  .topbar-brand {
    font-size: 14px;
  }

  .bottombar-nav a {
    font-size: 11px;
  }
}

/* ========================================
   Smart modern theme override
   X / Instagram inspired
======================================== */

:root {
  --bg: #f3f4f6;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-soft: rgba(255, 255, 255, 0.72);
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d9bf0;
  --primary-hover: #178ad6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(29, 155, 240, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.06), transparent 24%),
    #f3f4f6 !important;
  color: var(--text) !important;
}

body {
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 980px !important;
}

.topbar {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
}

.topbar-brand {
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
}

.topbar-menu summary {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px !important;
  padding: 0 14px !important;
}

.topbar-menu-panel {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14) !important;
}

.topbar-menu-panel a {
  color: #0f172a !important;
  font-weight: 600;
}

.topbar-menu-panel a:hover {
  background: rgba(29, 155, 240, 0.08) !important;
}

.topbar-user {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.topbar-user-name {
  color: #0f172a !important;
}

.topbar-user-role {
  color: #64748b !important;
}

.topbar-logout {
  background: rgba(15, 23, 42, 0.05) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
  border-radius: 999px !important;
}

.topbar-logout:hover {
  background: rgba(15, 23, 42, 0.08) !important;
}

.bottombar {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05) !important;
}

.bottombar-nav a {
  color: #64748b !important;
  font-weight: 700 !important;
}

.bottombar-nav a:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  color: #0f172a !important;
}

.card,
.panel,
.section-card,
.auth-card,
.table-card,
.stat-card,
.filter-card,
.table-wrap,
.help-box,
.hint-box,
.notice-box {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

.page-title,
h1,
h2,
h3 {
  letter-spacing: -0.02em;
}

.page-title,
h1 {
  font-weight: 800;
}

.page-subtitle,
.muted,
.help,
.hint,
.small {
  color: #64748b !important;
}


input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="search"],
select,
textarea {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(29, 155, 240, 0.45) !important;
  box-shadow: 0 0 0 4px rgba(29, 155, 240, 0.14) !important;
}

button,
.btn {
  border-radius: 999px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  box-shadow: none !important;
}

.btn-primary,
button[type="submit"] {
  background: linear-gradient(135deg, #1d9bf0, #2563eb) !important;
  border: none !important;
  color: #ffffff !important;
}

.btn-primary:hover,
button[type="submit"]:hover {
  background: linear-gradient(135deg, #178ad6, #1d4ed8) !important;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: none !important;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border: none !important;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border: none !important;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.86) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

table {
  background: transparent !important;
  min-width: 860px !important;
}

th,
td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  padding: 14px 14px !important;
}

th {
  background: rgba(248, 250, 252, 0.86) !important;
  color: #475569 !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
}

tr:hover td {
  background: rgba(29, 155, 240, 0.04) !important;
}

.badge,
.status-badge {
  border-radius: 999px !important;
  font-weight: 800 !important;
  padding: 5px 12px !important;
}

.flash,
.alert {
  border-radius: 16px !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.84) !important;
}

.progress {
  height: 10px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.08) !important;
}

.progress > span {
  background: linear-gradient(90deg, #1d9bf0, #8b5cf6) !important;
}

@media (max-width: 820px) {
  .page {
    max-width: 100% !important;
  }

  .card,
  .panel,
  .section-card,
  .auth-card,
  .table-card,
  .stat-card,
  .filter-card,
  .table-wrap {
    border-radius: 18px !important;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="email"],
  input[type="search"],
  select,
  textarea {
    border-radius: 14px !important;
  }
}

/* ========================================
   Compact business UI override
======================================== */

:root {
  --radius: 12px;
  --radius-sm: 8px;
}

/* 全体の密度を少し上げる */
body {
  font-size: 14px !important;
  line-height: 1.4 !important;
}

.page {
  max-width: 1100px !important;
}

.main-fixed-nav,
.main.main-fixed-nav {
  padding-top: 68px !important;
  padding-bottom: 62px !important;
}

/* ヘッダー・フッターを少し細く */
.topbar {
  height: 50px !important;
}

.topbar-inner {
  height: 50px !important;
  padding: 0 10px !important;
}

.topbar-brand {
  font-size: 14px !important;
}

.topbar-menu summary,
.topbar-logout {
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

.topbar-user {
  padding: 4px 8px !important;
  font-size: 11px !important;
}

.topbar-menu-panel {
  top: 36px !important;
  width: 200px !important;
  padding: 6px !important;
  border-radius: 10px !important;
}

.topbar-menu-panel a {
  padding: 8px 9px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

.bottombar {
  height: 46px !important;
}

.bottombar-nav {
  height: 46px !important;
  max-width: 720px !important;
}

.bottombar-nav a {
  font-size: 11px !important;
  padding: 0 2px !important;
}

/* カード・ボックスを小さめに */
.card,
.panel,
.section-card,
.auth-card,
.table-card,
.stat-card,
.filter-card,
.table-wrap,
.help-box,
.hint-box,
.notice-box {
  border-radius: 12px !important;
  padding: 12px !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05) !important;
}

.auth-card {
  max-width: 380px !important;
}

.stack,
.grid,
.grid-2,
.grid-3,
.grid-4,
.form-grid {
  gap: 10px !important;
}

/* 見出しも少し締める */
.page-header {
  margin-bottom: 12px !important;
  gap: 10px !important;
}

.page-title,
h1 {
  font-size: 1.35rem !important;
  margin: 0 0 4px !important;
}

h2 {
  font-size: 1.1rem !important;
  margin: 0 0 4px !important;
}

h3 {
  font-size: 0.98rem !important;
  margin: 0 0 4px !important;
}

.page-subtitle,
.muted,
.help,
.hint,
.small {
  font-size: 0.82rem !important;
}

/* KPIカードをコンパクトに */
.stat-card {
  padding: 12px !important;
}

.stat-card .label {
  font-size: 0.78rem !important;
  margin-bottom: 4px !important;
}

.stat-card .value {
  font-size: 1.35rem !important;
}

.stat-card .sub {
  margin-top: 4px !important;
  font-size: 0.78rem !important;
}

/* 入力系を詰める */

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="search"],
select,
textarea {
  padding: 9px 10px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

textarea {
  min-height: 88px !important;
}

.checkbox-row,
.inline-checks,
.inline-actions,
.inline-fields,
.action-row {
  gap: 8px !important;
}

/* ボタンを細く */
button,
.btn {
  padding: 7px 12px !important;
  min-height: 32px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
}

/* テーブルを詰める */
.table-wrap {
  border-radius: 12px !important;
}

table {
  min-width: 760px !important;
}

th,
td {
  padding: 9px 10px !important;
  font-size: 12px !important;
}

th {
  font-size: 11px !important;
}

.badge,
.status-badge {
  padding: 3px 8px !important;
  font-size: 10px !important;
  border-radius: 999px !important;
}

/* フラッシュも小さめ */
.flash,
.alert {
  padding: 9px 11px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
}

.flash-wrap {
  gap: 8px !important;
  margin-bottom: 10px !important;
}

/* 定義リスト */
.definition-item {
  grid-template-columns: 140px 1fr !important;
  gap: 8px !important;
  padding: 7px 0 !important;
}

/* ログイン画面も詰める */
.auth-wrap {
  padding: 16px !important;
}

.auth-card h1 {
  font-size: 1.35rem !important;
  margin-bottom: 4px !important;
}

.auth-card p {
  margin-bottom: 12px !important;
}

/* モバイルはさらに無駄を減らす */
@media (max-width: 820px) {
  body {
    font-size: 13px !important;
  }

  .main-fixed-nav,
  .main.main-fixed-nav {
    padding-top: 60px !important;
    padding-bottom: 58px !important;
  }

  .card,
  .panel,
  .section-card,
  .auth-card,
  .table-card,
  .stat-card,
  .filter-card,
  .table-wrap {
    padding: 10px !important;
    border-radius: 10px !important;
  }

  .page-title,
  h1 {
    font-size: 1.2rem !important;
  }

  .topbar-brand {
    font-size: 13px !important;
  }

  .bottombar-nav a {
    font-size: 10px !important;
  }
}

/* ========================================
   Horizontal compact layout + badges
======================================== */

/* カード内を横レイアウト化 */
.card,
.section-card,
.table-card,
.stat-card,
.filter-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

/* カード内のテキストを圧縮 */
.card .content,
.section-card .content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* バッジ（チップ） */
.badge,
.chip,
.status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-weight: 700;
}

/* 種類別バッジ */
.badge-primary {
  background: rgba(29, 155, 240, 0.12);
  color: #1d9bf0;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* 横並び情報グループ */
.inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

/* カードの右側操作エリア */
.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ボタンさらに圧縮 */
.btn,
button {
  padding: 6px 10px !important;
  font-size: 11px !important;
}

/* テーブルさらに詰める */
th, td {
  padding: 7px 8px !important;
}

/* モバイルでは縦に戻す */
@media (max-width: 820px) {
  .card,
  .section-card,
  .table-card,
  .stat-card {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* ========================================
   Counter page v2
======================================== */

.compact-filter-bar {
  margin-bottom: 12px;
  gap: 8px !important;
}

.compact-filter-bar input,
.compact-filter-bar select {
  max-width: 240px;
}

.counter-list-v2 {
  display: grid;
  gap: 12px;
}

.counter-card-v2 {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.counter-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.counter-card-title a {
  color: #0f172a !important;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none !important;
}

.counter-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.chip-code {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.chip-status {
  background: rgba(29, 155, 240, 0.12);
  color: #0369a1;
}

.chip-count {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.chip-remain {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.chip-rate {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.chip-daily {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
}

.counter-assignment-list {
  display: grid;
  gap: 8px;
}

.counter-assignment-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.counter-assignment-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.assignment-person {
  min-width: 0;
}

.assignment-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.assignment-controls {
  display: grid;
  grid-template-columns: 90px minmax(160px, 1fr) auto 110px auto;
  gap: 8px;
  align-items: end;
}

.assignment-field {
  display: grid;
  gap: 4px;
}

.assignment-field label {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.assignment-field input {
  height: 34px;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
}

.assignment-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.assignment-buttons .btn,
.assignment-buttons button {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
}

@media (max-width: 980px) {
  .counter-assignment-row {
    grid-template-columns: 1fr;
  }

  .assignment-controls {
    grid-template-columns: 1fr 1fr;
  }

  .assignment-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .counter-card-v2 {
    padding: 10px;
  }

  .counter-card-title a {
    font-size: 14px;
  }

  .assignment-controls {
    grid-template-columns: 1fr;
  }

  .compact-filter-bar input,
  .compact-filter-bar select {
    max-width: 100%;
  }
}

/* ========================================
   X-like theme trial
======================================== */

body.xlike-body {
  background: #f7f9f9 !important;
  color: #0f1419 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.x-main {
  padding-top: 58px;
  padding-bottom: 48px;
}

.x-page-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px;
}

.x-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #eff3f4;
  z-index: 9999;
}

.x-topbar-inner {
  max-width: 980px;
  height: 52px;
  margin: 0 auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  align-items: center;
}

.x-brand {
  color: #0f1419 !important;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none !important;
}

.x-main-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
}

.x-main-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #536471 !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.x-main-tabs a:hover {
  background: #eff3f4;
  color: #0f1419 !important;
}

.x-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x-menu {
  position: relative;
}

.x-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff3f4;
  color: #0f1419;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.x-menu summary::-webkit-details-marker {
  display: none;
}

.x-menu-panel {
  position: absolute;
  top: 38px;
  right: 0;
  width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid #eff3f4;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15,20,25,0.14);
}

.x-menu-panel a {
  display: block;
  padding: 9px 10px;
  color: #0f1419 !important;
  text-decoration: none !important;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.x-menu-panel a:hover {
  background: #f7f9f9;
}

.x-user,
.x-logout {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff3f4;
  color: #0f1419 !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
}

.x-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,0.92);
  border-top: 1px solid #eff3f4;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
}

.x-bottombar-inner {
  max-width: 760px;
  height: 42px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.x-bottombar-inner a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #536471 !important;
  text-decoration: none !important;
  font-size: 11px;
  font-weight: 700;
}

.x-bottombar-inner a:hover {
  background: #f7f9f9;
  color: #0f1419 !important;
}

.x-page-header {
  margin-bottom: 12px;
  padding: 4px 2px;
}

.x-page-header h1 {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f1419;
}

.x-page-header p {
  margin: 0;
  font-size: 13px;
  color: #536471;
}

.x-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.x-kpi {
  background: #fff;
  border: 1px solid #eff3f4;
  border-radius: 16px;
  padding: 10px 12px;
}

.x-kpi-label {
  font-size: 11px;
  color: #536471;
  margin-bottom: 4px;
}

.x-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f1419;
}

.x-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
}

.x-section-card {
  background: #fff;
  border: 1px solid #eff3f4;
  border-radius: 16px;
  overflow: hidden;
}

.x-section-head {
  padding: 12px 14px;
  border-bottom: 1px solid #eff3f4;
}

.x-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f1419;
}

.x-feed {
  display: grid;
}

.x-feed-item {
  padding: 12px 14px;
  border-bottom: 1px solid #eff3f4;
  background: #fff;
}

.x-feed-item:last-child {
  border-bottom: 70px;
}

.x-feed-item:hover {
  background: #fafafa;
}

.x-feed-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.x-feed-title {
  color: #0f1419 !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 800;
}

.x-feed-title:hover {
  text-decoration: underline !important;
}

.x-feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #536471;
  font-size: 12px;
  margin-bottom: 8px;
}

.x-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1d9bf0;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.x-pill-soft {
  background: #eff3f4;
  color: #536471;
}

.x-progress {
  height: 6px;
  background: #eff3f4;
  border-radius: 999px;
  overflow: hidden;
}

.x-progress span {
  display: block;
  height: 100%;
  background: #1d9bf0;
}

.x-mini-list {
  display: grid;
}

.x-mini-item {
  padding: 10px 14px;
  border-bottom: 1px solid #eff3f4;
}

.x-mini-item:last-child {
  border-bottom: 70px;
}

.x-mini-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f1419;
  margin-bottom: 4px;
}

.x-mini-sub {
  font-size: 12px;
  color: #536471;
}

.x-mini-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.x-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.x-toolbar input,
.x-toolbar select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cfd9de !important;
  border-radius: 999px !important;
  background: #fff !important;
  font-size: 13px !important;
}

.x-toolbar button {
  height: 36px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #0f1419 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.x-counter-item {
  padding-bottom: 8px;
}

.x-counter-rows {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.x-counter-row {
  display: grid;
  grid-template-columns: 110px 76px minmax(120px, 1fr) auto 100px auto;
  gap: 8px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px dashed #eff3f4;
}

.x-counter-person {
  font-size: 13px;
  font-weight: 800;
  color: #0f1419;
}

.x-counter-field {
  display: grid;
  gap: 4px;
}

.x-counter-field label {
  font-size: 11px;
  color: #536471;
  font-weight: 700;
}

.x-counter-field input {
  height: 34px;
  padding: 0 10px !important;
  border: 1px solid #cfd9de !important;
  border-radius: 10px !important;
  background: #fff !important;
  font-size: 12px !important;
}

.x-counter-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.x-counter-actions button {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #0f1419 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.x-counter-actions .x-btn-soft {
  background: #eff3f4 !important;
  color: #0f1419 !important;
}

.x-flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.x-flash {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eff3f4;
  font-size: 12px;
  font-weight: 700;
}

.x-flash-success { color: #047857; }
.x-flash-error { color: #b91c1c; }
.x-flash-warning { color: #b45309; }
.x-flash-info { color: #0369a1; }

@media (max-width: 980px) {
  .x-topbar-inner {
    grid-template-columns: 140px 1fr auto;
  }

  .x-columns {
    grid-template-columns: 1fr;
  }

  .x-counter-row {
    grid-template-columns: 1fr 1fr;
  }

  .x-counter-person {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .x-topbar-center {
    display: none;
  }

  .x-topbar-inner {
    grid-template-columns: 1fr auto;
  }

  .x-user,
  .x-logout {
    display: none;
  }

  .x-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .x-counter-row {
    grid-template-columns: 1fr;
  }

  .x-bottombar-inner a {
    font-size: 10px;
  }
}

/* ========================================
   fix: logout visible + dashboard numbers
======================================== */

.x-topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.x-kpi {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-height: 74px !important;
}

.x-kpi-value {
  display: block !important;
  color: #0f1419 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 700px) {
  .x-logout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
  }

  .x-user {
    display: none !important;
  }

  .x-topbar-right {
    gap: 6px !important;
  }
}

/* ========================================
   profile + compact counter + modal
======================================== */

.x-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #eff3f4;
  border-radius: 16px;
}

.x-profile-name {
  font-size: 18px;
  font-weight: 800;
  color: #0f1419;
  margin-bottom: 6px;
}

.x-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.x-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.x-profile-stat {
  padding: 10px 12px;
  background: #f7f9f9;
  border: 1px solid #eff3f4;
  border-radius: 14px;
}

.x-profile-stat-label {
  font-size: 11px;
  color: #536471;
  margin-bottom: 4px;
}

.x-profile-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: #0f1419;
}

.x-counter-item {
  padding-bottom: 6px;
}

.x-count-chip-button {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #0f1419;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.x-count-chip-button:hover {
  opacity: 0.92;
}

.x-counter-row-compact {
  grid-template-columns: 120px 88px auto;
  gap: 8px;
  align-items: end;
}

.x-counter-field-small input {
  width: 88px;
}

.x-modal {
  width: min(92vw, 420px);
  border: 1px solid #eff3f4;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 18px 48px rgba(15, 20, 25, 0.18);
}

.x-modal::backdrop {
  background: rgba(15, 20, 25, 0.32);
}

.x-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eff3f4;
  background: #fff;
}

.x-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f1419;
}

.x-modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #eff3f4;
  color: #0f1419;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.x-modal-body {
  padding: 16px;
  background: #fff;
}

.x-modal-current {
  font-size: 13px;
  color: #536471;
  margin-bottom: 12px;
}

.x-modal-form {
  display: grid;
  gap: 12px;
}

.x-modal-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f1419;
}

.x-modal-form input {
  height: 38px;
  padding: 0 12px !important;
  border: 1px solid #cfd9de !important;
  border-radius: 12px !important;
  background: #fff !important;
  font-size: 13px !important;
}

.x-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 980px) {
  .x-profile-card {
    grid-template-columns: 1fr;
  }

  .x-counter-row-compact {
    grid-template-columns: 1fr 88px auto;
  }
}

@media (max-width: 700px) {
  .x-profile-stats {
    grid-template-columns: 1fr;
  }

  .x-counter-row-compact {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .x-counter-field-small input {
    width: 100%;
  }

  .x-modal-actions {
    flex-direction: column;
  }
}

/* ========================================
   Counter sheet card style
======================================== */

.counter-sheet-meta span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(120,72,50,0.08);
}

.counter-sheet-footer span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.46);
}

@media (max-width: 700px) {

/* ========================================
   Counter sheet compact size tweak
======================================== */

.counter-sheet-meta span {
  padding: 3px 8px !important;
}

/* ここは配置そのまま */

.counter-sheet-footer span {
  padding: 4px 8px !important;
}

@media (max-width: 700px) {

/* ========================================
   横並びカウンター（超シンプル）
======================================== */

.counter-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f5f1ef;
  border: 1px solid rgba(0,0,0,0.06);
}

/* 左：画像 */
.counter-row-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
}

/* 中央 */
.counter-row-main {
  flex: 1;
  margin-left: 10px;
}

.counter-row-name {
  font-size: 14px;
  color: #333;
}

.counter-row-count {
  font-size: 22px;
  font-weight: bold;
  color: #111;
}

/* 右 */
.counter-row-actions {
  display: flex;
  gap: 6px;
}

.counter-row-actions button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* マイナス */
.btn-minus {
  background: #d6d3e5;
}

/* プラス */
.btn-plus {
  background: #e7c2a8;
}

/* ========================================
   数字タップで直接編集モーダル
======================================== */

.counter-row-inline-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 10px;
}

.count-edit-dialog {
  width: min(92vw, 360px);
  border: none;
  padding: 0;
  background: transparent;
}

.count-edit-dialog::backdrop {
  background: rgba(15, 20, 25, 0.35);
}

.count-edit-dialog-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 20, 25, 0.22);
  border: 1px solid rgba(0,0,0,0.06);
}

.count-edit-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.count-edit-dialog-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.count-edit-close {
  width: 34px;
  height: 34px;
  border-radius: 999px !important;
  border: none !important;
  background: #f2f2f2 !important;
  color: #222 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.count-edit-current {
  padding: 12px 14px 6px;
  font-size: 13px;
  color: #666;
}

.count-edit-form {
  padding: 8px 14px 14px;
}

.count-edit-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #333;
}

.count-edit-input {
  width: 100%;
  height: 42px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  background: #fff !important;
  padding: 0 12px !important;
  font-size: 15px !important;
  margin-bottom: 12px !important;
}

.count-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.count-edit-cancel,
.count-edit-save {
  height: 38px !important;
  min-height: 0 !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.count-edit-cancel {
  background: #f2f2f2 !important;
  color: #333 !important;
  border: none !important;
}

.count-edit-save {
  background: #111 !important;
  color: #fff !important;
  border: none !important;
}

/* ========================================
   Dashboard mypage layout
======================================== */

.mypage-wrap {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.mypage-header {
  padding: 10px 4px 2px;
  text-align: center;
}

.mypage-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f1419;
}

.mypage-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #eff3f4;
  border-radius: 14px;
}

.mypage-profile-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mypage-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #477d93;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid rgba(205, 184, 108, 0.8);
  flex: 0 0 auto;
}

.mypage-profile-text {
  min-width: 0;
}

.mypage-profile-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f1419;
  margin-bottom: 2px;
}

.mypage-profile-sub {
  font-size: 12px;
  color: #536471;
}

.mypage-profile-arrow {
  font-size: 24px;
  color: #b0b7bd;
  line-height: 1;
  flex: 0 0 auto;
}

.mypage-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mypage-action-btn {
  height: 46px;
  border-radius: 10px;
  color: #fff !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}

.mypage-action-btn-green {
  background: #27b7a5;
}

.mypage-action-btn-blue {
  background: #1f7fe5;
}

.mypage-section {
  background: transparent;
}

.mypage-section-title {
  background: #eef1f2;
  color: #333;
  font-size: 15px;
  font-weight: 800;
  padding: 10px 14px;
  border-top: 1px solid #dde3e6;
  border-bottom: 1px solid #dde3e6;
}

.mypage-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid #eff3f4;
  text-decoration: none !important;
}

.mypage-menu-item:first-of-type {
  border-top: 0;
}

.mypage-menu-main {
  min-width: 0;
}

.mypage-menu-label {
  color: #0f1419;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.mypage-menu-sub {
  color: #7b8790;
  font-size: 12px;
}

.mypage-menu-arrow {
  font-size: 24px;
  color: #c2c8cc;
  line-height: 1;
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .mypage-wrap {
    gap: 10px;
  }

  .mypage-profile-card,
  .mypage-menu-item {
    padding: 12px;
  }

  .mypage-action-row {
    grid-template-columns: 1fr 1fr;
  }

  .mypage-action-btn {
    font-size: 14px;
    height: 44px;
  }

  .mypage-menu-label {
    font-size: 14px;
  }
}

/* ========================================
   上部プロフィール（マイページ風）
======================================== */

.mypage-top-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  border-bottom: 1px solid #e6ecf0;
  background: #fff;
}

.mypage-top-avatar {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #477d93;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.mypage-top-text {
  display: flex;
  flex-direction: column;
}

.mypage-top-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f1419;
}

.mypage-top-role {
  font-size: 12px;
  color: #536471;
}

/* 1アイコン版プロフィール */
.mypage-profile-card-single {
  padding: 14px !important;
}

.mypage-profile-avatar-single {
  width: 58px !important;
  height: 58px !important;
  border-radius: 999px !important;
  background: #477d93 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  border: 2px solid rgba(205, 184, 108, 0.8) !important;
  box-shadow: none !important;
}

.mypage-profile-card-single .mypage-profile-name {
  font-size: 17px !important;
}

.mypage-profile-card-single .mypage-profile-sub {
  font-size: 12px !important;
  color: #536471 !important;
}

@media (max-width: 700px) {
  .mypage-profile-avatar-single {
    width: 52px !important;
    height: 52px !important;
    font-size: 20px !important;
  }
}

/* プロフィール強調 */
.mypage-profile-card-single .mypage-profile-name {
  font-size: 18px !important;
  font-weight: 800 !important;
}

.mypage-profile-card-single .mypage-profile-sub {
  font-size: 13px !important;
  color: #444 !important;
  margin-top: 2px;
}

.profile-edit-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
}

.profile-edit-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f1419;
}

.profile-edit-form input {
  height: 40px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  padding: 0 12px !important;
  font-size: 14px !important;
}

.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-edit-actions button {
  height: 40px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  background: #111 !important;
  color: #fff !important;
  border: none !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.row-actions form {
  margin: 0;
}

.mini-link-btn {
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  color: #111 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

textarea {
  border: 1px solid #d7dee2 !important;
  border-radius: 10px !important;
  background: #fff !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
}


.project-check-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f1419 !important;
}

.project-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.section-title-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ========================================
   Counter A+B input UI
======================================== */

.counter-page-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.counter-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.counter-toolbar input,
.counter-toolbar select {
  height: 38px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  padding: 0 12px !important;
  font-size: 13px !important;
}

.counter-toolbar button {
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: none !important;
  background: #111 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.counter-row-card-v2 {
  background: #f5f1ef;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}

.counter-row-top {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.counter-row-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.counter-row-main {
  min-width: 0;
}

.counter-row-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.counter-row-name {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}

.counter-row-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  color: #555;
  font-size: 11px;
  font-weight: 700;
}

.counter-row-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 6px;
  color: #666;
  font-size: 11px;
}

.counter-quick-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.counter-quick-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px !important;
  border: none !important;
  min-height: 0 !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.counter-quick-minus {
  background: #d6d3e5 !important;
  color: #333 !important;
}

.counter-quick-plus {
  background: #e7c2a8 !important;
  color: #333 !important;
}

.counter-batch-area {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}

.counter-batch-form {
  display: grid;
  gap: 6px;
}

.counter-batch-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
}

.counter-batch-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.counter-batch-input {
  height: 36px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  background: #fff !important;
  padding: 0 10px !important;
  font-size: 14px !important;
  text-align: center;
}

.counter-batch-btn {
  height: 36px !important;
  border-radius: 10px !important;
  border: none !important;
  min-height: 0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.counter-batch-add {
  background: #111 !important;
  color: #fff !important;
}

.counter-batch-sub {
  background: #ececec !important;
  color: #333 !important;
}

.counter-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.counter-chip-row form {
  margin: 0;
}

.counter-chip {
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  background: #fff !important;
  color: #333 !important;
  min-height: 0 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

@media (max-width: 700px) {
  .counter-row-top {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .counter-quick-form {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .counter-row-avatar {
    width: 44px;
    height: 44px;
  }

/* counter quick fix */
.counter-quick-form form,
.counter-chip-row form {
  margin: 0;
}

.counter-more-box {
  margin-top: 8px;
}

.counter-more-box summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  color: #444;
  font-size: 11px;
  font-weight: 700;
}

.counter-more-box summary::-webkit-details-marker {
  display: none;
}

.counter-more-box[open] summary {
  margin-bottom: 8px;
}

.counter-batch-area {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
}

/* ========================================
   Analytics page
======================================== */

.analytics-wrap {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.analytics-filter-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 14px;
  padding: 12px;
}

.analytics-date-form {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.analytics-date-center {
  display: grid;
  gap: 6px;
}

.analytics-date-label {
  font-size: 12px;
  font-weight: 700;
  color: #536471;
}

.analytics-date-input {
  height: 40px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  padding: 0 12px !important;
  font-size: 14px !important;
}

.analytics-nav-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d7dee2;
  background: #fff;
  color: #111 !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.analytics-nav-submit {
  border: none !important;
  background: #111 !important;
  color: #fff !important;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.analytics-kpi-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 14px;
  padding: 14px;
}

.analytics-kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: #536471;
  margin-bottom: 6px;
}

.analytics-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f1419;
  line-height: 1.2;
}

@media (max-width: 820px) {
  .analytics-date-form {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-date-center {
    grid-column: 1 / -1;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }

  .analytics-date-form {
    grid-template-columns: 1fr;
  }

  .analytics-nav-btn,
  .analytics-nav-submit {
    width: 100%;
  }
}

/* compact counter date selector */
.counter-date-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 10px;
}

.counter-date-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e6e9ed;
  border-radius: 999px;
  padding: 6px 8px;
}

.counter-date-input {
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 999px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  width: 150px;
}

.counter-date-apply,
.counter-date-nav {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  color: #111 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}

.counter-date-apply {
  border: none !important;
  background: #111 !important;
  color: #fff !important;
}

/* visible daily count */

@media (max-width: 700px) {
  .counter-date-bar {
    justify-content: stretch;
  }

  .counter-date-form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .counter-date-input {
    width: 100%;
    min-width: 0;
  }

/* force visible daily count */

/* ===== compact header ===== */

/* ===== 横1列ボタン ===== */

/* ボタンサイズ調整 */

/* ===== project ui refresh ===== */

.badge-muted {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.project-page-wrap,
.project-detail-page,
.project-edit-page {
  max-width: 960px;
  margin: 0 auto;
}

.project-list-section {
  margin-top: 8px;
}

.project-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid #e6ebf2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-card-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.project-card-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: #111827;
  word-break: break-word;
}

.project-card-client {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.project-card-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-delete-form {
  margin: 0;
}

.danger-btn {
  border-color: #fecaca !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.project-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.project-card-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f8fbff;
  border: 1px solid #dde7f8;
  color: #46679d;
  font-size: 12px;
  font-weight: 700;
}

.project-meta-text {
  font-size: 13px;
  color: #667085;
  line-height: 1.5;
}

.project-top-nav {
  margin-bottom: 12px;
  display: flex;
  justify-content: flex-start;
}

.project-hero-panel {
  margin-bottom: 16px;
}

.project-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-hero-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: #111827;
}

.project-hero-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}

.project-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.project-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.project-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.project-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.project-check-item span {
  font-size: 14px;
  color: #111827;
  line-height: 1.4;
}

.project-notify-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #dde7f8;
}

.project-notify-label {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

.project-notify-help {
  margin-top: 6px;
  font-size: 12px;
  color: #667085;
}

.project-inline-add-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-inline-add-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-inline-add-form input,
.project-inline-add-form select,
.project-inline-add-form textarea {
  width: 100%;
}

@media (max-width: 700px) {
  .project-card {
    padding: 14px;
    border-radius: 16px;
  }

  .project-card-head,
  .project-hero-head {
    flex-direction: column;
    align-items: stretch;
  }

  .project-card-actions,
  .project-hero-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .project-card-title {
    font-size: 18px;
  }

  .project-hero-title {
    font-size: 22px;
  }


  .project-meta-chip {
    min-height: 28px;
    font-size: 11px;
  }
}

/* ===== projects index ui ===== */

.project-index-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 12px 12px;
}

.project-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.project-index-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.project-index-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-index-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.project-card-link-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.project-card-inner {
  position: relative;
  z-index: 2;
  padding: 10px;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.project-card-top-main {
  min-width: 0;
  flex: 1 1 auto;
}

.project-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.project-card-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
  word-break: break-word;
}

.project-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.project-status-badge.is-active {
  color: #2563eb;
  background: #eaf3ff;
  border-color: #cfe0ff;
}

.project-status-badge.is-stop {
  color: #6b7280;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.project-status-badge.is-end {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.project-card-client {
  margin-top: 6px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.project-label-inline {
  color: #6b7280;
  margin-right: 6px;
}

.project-card-actions {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.project-card-actions form {
  margin: 0;
}

.project-delete-btn {
  border-color: #fecaca !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.project-card-middle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.project-number-box {
  padding: 10px;
  background: #f8fbff;
  border: 1px solid #dde7f8;
  border-radius: 14px;
}

.project-number-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
}

.project-number-value {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.project-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-info-block {
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}

.project-info-block:first-child {
  padding-top: 0;
  border-top: none;
}

.project-info-label {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  line-height: 1.4;
}

.project-info-value {
  font-size: 14px;
  color: #111827;
  line-height: 1.65;
  word-break: break-word;
}

.project-info-long {
  white-space: pre-wrap;
}

.project-add-panel {
  margin-top: 14px;
}

.project-add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-add-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-add-form input,
.project-add-form select,
.project-add-form textarea {
  width: 100%;
}


.project-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.project-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.project-check-item span {
  font-size: 13px;
  color: #111827;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .project-index-page {
    padding: 8px 10px 12px;
  }

  .project-index-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-card-top {
    flex-direction: column;
    align-items: stretch;
  }

  .project-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .project-card-middle {
    grid-template-columns: 1fr;
  }


  .project-card-title {
    font-size: 17px;
  }

  .project-number-value {
    font-size: 17px;
  }
}

/* ===== project edit detail layout ===== */

.project-static-value {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.project-prewrap {
  white-space: pre-wrap;
}

.project-long-textarea {
  min-height: 120px;
  line-height: 1.75 !important;
  white-space: pre-wrap;
  resize: vertical;
}

.project-edit-form .panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.project-edit-form .panel {
  padding: 14px;
}

@media (max-width: 700px) {
  .project-edit-form .panel {
    padding: 12px;
  }

  .project-long-textarea {
    min-height: 110px;
  }

  .project-static-value {
    padding: 10px;
  }
}

/* ===== project edit/list additional fixes ===== */

.project-edit-form input[type="text"],
.project-edit-form input[type="date"],
.project-edit-form input[type="number"],
.project-edit-form select {
  min-height: 44px;
}

.project-long-textarea {
  min-height: 108px !important;
  line-height: 1.7 !important;
}

.project-index-list-compact {
  gap: 10px;
}

.project-index-card-compact {
  border-radius: 16px;
}

.project-card-inner-compact {
  padding: 9px 10px;
}

.project-card-top-compact {
  margin-bottom: 70px;
  gap: 8px;
}

.project-card-client-compact {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .project-card-inner-compact {
    padding: 9px;
  }

  .project-card-top-compact {
    gap: 8px;
  }

  .project-edit-form input[type="text"],
  .project-edit-form input[type="date"],
  .project-edit-form input[type="number"],
  .project-edit-form select {
    min-height: 42px;
  }

  .project-long-textarea {
    min-height: 96px !important;
  }
}


/* ===== unified check grid ===== */

.project-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 700px) {
  .project-check-grid,
  .project-checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== project ops cards ===== */

.project-ops-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-ops-card {
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  padding: 12px;
}

.project-ops-card-head {
  margin-bottom: 10px;
}

.project-ops-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  line-height: 1.4;
}

.project-ops-card-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.project-notify-box-card {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.project-setting-row {
  margin: 0;
}

.project-setting-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.project-setting-row select,
.project-setting-row input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #d6dfeb;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.project-setting-row select:focus,
.project-setting-row input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.20);
  outline: none;
}

.project-ops-card .project-check-grid {
  gap: 10px;
}

.project-ops-card .project-check-item {
  min-height: 48px;
  border: 1px solid #dfe7f1;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.project-ops-card .project-check-item span {
  font-weight: 700;
  color: #1f2937;
}

.project-notify-box-card .project-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-notify-box-card .project-check-item {
  min-height: 46px;
}

@media (max-width: 700px) {
  .project-ops-card {
    border-radius: 16px;
    padding: 12px;
  }

  .project-ops-card-head {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .project-ops-card-title {
    font-size: 14px;
  }

  .project-notify-box-card .project-checkbox-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ===== project edit top/back + submit polish ===== */

.project-top-nav-right {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.project-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
  background: #ffffff;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.project-back-link:hover {
  background: #f8fbff;
}

.project-submit-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin-top: 24px;
  padding: 12px 10px;
  background: #ffffff;
  border-top: 1px solid #e5eaf2;
  z-index: 50;
}

.project-submit-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  min-height: 48px;
  margin: 0 auto;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #39a7ff 0%, #2f6df0 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(47, 109, 240, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.project-submit-btn:hover {
  filter: brightness(1.02);
  box-shadow: 0 12px 24px rgba(47, 109, 240, 0.26);
}

.project-submit-btn:active {
  transform: translateY(1px) scale(0.99);
}

.project-edit-form-submit-space {
  padding-bottom: 80px;
}

@media (max-width: 700px) {
  .project-top-nav-right {
    margin-bottom: 10px;
  }

  .project-back-link {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 12px;
  }

  .project-submit-bar {
    margin-top: 14px;
    padding: 10px 8px;
  }

  .project-submit-btn {
    min-height: 46px;
    border-radius: 13px;
    font-size: 14px;
  }

  .project-edit-form-submit-space {
    padding-bottom: 70px;
  }
}



/* ===== panel role separation ===== */

.panel-form {
  padding: 14px !important;
}

.panel-empty {
  text-align: center;
  color: #6b7280;
  padding: 18px 14px !important;
}

.panel-empty .muted {
  margin: 0;
}

/* ===== form-grid role separation ===== */

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}





.project-image-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.project-image-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-image-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.project-edit-form .image-grid figure {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ===== project edit image thumbnails ===== */

.project-image-selected-name {
  margin-top: 6px;
  min-height: 18px;
}

.project-edit-form .image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.project-edit-form .image-grid figure {
  margin: 0;
  align-items: flex-start;
  width: 140px;
}

.project-edit-form .image-grid img {
  width: 140px;
  height: 96px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  display: block;
  margin: 0;
  background: #ffffff;
}

.project-edit-form .image-grid figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

@media (max-width: 700px) {
  .project-edit-form .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-edit-form .image-grid img {
    width: 120px;
    height: 84px;
  }
}



/* ===== project edit picker + ops final polish ===== */

.project-image-picker-btn {
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid #dbe5f1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.project-image-picker-btn:hover {
  background: #f8fbff !important;
}

.project-ops-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.project-ops-card {
  border: 1px solid #dbe5f1 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255,255,255,0.92) !important;
  padding: 14px !important;
}

.project-ops-card-head {
  margin-bottom: 12px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #e8eef6 !important;
}

.project-ops-card-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  letter-spacing: -0.01em !important;
}

.project-ops-card-sub {
  margin-top: 3px !important;
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.55 !important;
}

.project-setting-row label {
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #334155 !important;
}

.project-setting-row select,
.project-setting-row input {
  width: 100% !important;
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 1px solid #d6dfeb !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

.project-setting-row select:focus,
.project-setting-row input:focus {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.20) !important;
  outline: none !important;
}

@media (max-width: 700px) {
  .project-image-picker-btn {
    min-height: 36px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
  }

  .project-ops-card {
    border-radius: 16px !important;
    padding: 12px !important;
  }

  .project-ops-card-head {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
  }

  .project-ops-card-title {
    font-size: 14px !important;
  }

  .project-ops-card-sub {
    font-size: 11px !important;
  }
}



/* ===== project image picker hard fix ===== */

.project-image-picker-row > .project-image-picker-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 120px !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid #dbe5f1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.project-image-picker-row > .project-image-picker-btn:hover {
  background: #f8fbff !important;
}

.project-image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.project-image-preview-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 140px;
}

.project-image-preview-thumb {
  width: 140px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.project-image-preview-item figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

@media (max-width: 700px) {
  .project-image-picker-row > .project-image-picker-btn {
    min-height: 36px !important;
    min-width: 110px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
  }

  .project-image-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-image-preview-item,
  .project-image-preview-thumb {
    width: 120px;
  }

  .project-image-preview-thumb {
    height: 84px;
  }
}



/* ===== project edit image live preview ===== */

.project-image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.project-image-preview-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 140px;
}

.project-image-preview-thumb {
  width: 140px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.project-image-preview-item figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

@media (max-width: 700px) {
  .project-image-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-image-preview-item,
  .project-image-preview-thumb {
    width: 120px;
  }

  .project-image-preview-thumb {
    height: 84px;
  }
}



/* ===== project image picker button final fix ===== */

#projectImagePickerButton.project-image-picker-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 120px !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid #dbe5f1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#projectImagePickerButton.project-image-picker-btn:hover {
  background: #f8fbff !important;
}

.project-image-preview-remove {
  min-height: 32px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
}

@media (max-width: 700px) {
  #projectImagePickerButton.project-image-picker-btn {
    min-height: 36px !important;
    min-width: 110px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
  }
}


/* ===== unified delete button ===== */

.project-image-preview-remove,
.project-edit-form .image-grid button.mini-link-btn {
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  background: #fff !important;
  color: #ef4444 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.project-image-preview-remove:hover,
.project-edit-form .image-grid button.mini-link-btn:hover {
  background: #fff1f2 !important;
  border-color: #fecaca !important;
}



/* ===== project edit design phase 1 ===== */

.project-edit-page {
  padding: 8px 0 18px;
}

.project-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-edit-panel {
  border-radius: 20px !important;
  border: 1px solid #e5edf6 !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05) !important;
  padding: 16px !important;
}

.project-edit-panel > h2 {
  margin: 0 0 14px !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

.project-dm-template-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#dm-template-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-dm-card {
  margin-bottom: 0 !important;
  padding: 14px !important;
  border-radius: 16px !important;
  border: 1px solid #e6edf5 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04) !important;
}

.project-dm-card label + label {
  margin-top: 10px;
}

.project-dm-add-btn,
.project-dm-remove-btn {
  align-self: flex-start;
}

.project-dm-remove-btn {
  margin-top: 8px;
}

.project-image-picker-row {
  margin-top: 4px;
}

.project-image-selected-name {
  color: #64748b !important;
}

.project-saved-image-grid,
.project-image-preview-grid {
  margin-top: 12px !important;
}

.project-edit-form .image-grid figure,
.project-image-preview-item {
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #edf2f7;
  background: #ffffff;
}

.project-edit-form .image-grid figcaption,
.project-image-preview-item figcaption {
  color: #475569;
}

.project-submit-bar {
  border-top: 1px solid #e8eef6 !important;
  background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.88)) !important;
  backdrop-filter: blur(8px) !important;
}

.project-submit-btn {
  max-width: 460px !important;
}

@media (max-width: 700px) {
  .project-edit-page {
    padding: 4px 0 14px;
  }

  .project-edit-panel {
    border-radius: 18px !important;
    padding: 14px !important;
  }

  .project-edit-panel > h2 {
    font-size: 16px !important;
    margin-bottom: 12px !important;
  }

  .project-dm-card {
    border-radius: 14px !important;
    padding: 12px !important;
  }
}



/* ===== project edit design phase 2 ===== */

.project-edit-page {
  padding: 10px 0 22px;
}

.project-edit-form {
  gap: 18px;
}

.project-edit-panel {
  position: relative;
  overflow: hidden;
  border-radius: 22px !important;
  border: 1px solid #e4edf7 !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249,252,255,0.98) 100%) !important;
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255,255,255,0.92) !important;
  padding: 18px !important;
}

.project-edit-panel > h2 {
  margin: 0 0 16px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

.project-edit-panel > h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa 0%, #93c5fd 100%);
}

.project-edit-form .form-grid.two {
  gap: 14px 12px;
}

.project-edit-form .form-grid.single {
  gap: 14px;
}

.project-edit-form label {
  gap: 7px;
}

.project-edit-form input[type="text"],
.project-edit-form input[type="date"],
.project-edit-form input[type="number"],
.project-edit-form select,
.project-edit-form textarea {
  border-radius: 14px !important;
}

.project-long-textarea {
  min-height: 116px !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.project-dm-template-wrap {
  gap: 14px;
}

#dm-template-list {
  gap: 12px;
}

.project-dm-card {
  position: relative;
  border-radius: 18px !important;
  border: 1px solid #e8eef7 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04) !important;
  padding: 15px !important;
}

.project-dm-add-btn {
  min-height: 36px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
}

.project-dm-remove-btn {
  min-height: 34px !important;
}

.project-image-picker-row {
  margin-top: 6px;
}

.project-image-selected-name {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b !important;
}

.project-saved-image-grid,
.project-image-preview-grid {
  gap: 12px !important;
}

.project-edit-form .image-grid figure,
.project-image-preview-item {
  width: 148px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e8eef5;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.project-edit-form .image-grid img,
.project-image-preview-thumb {
  width: 148px;
  height: 100px;
  border-radius: 12px;
  background: #f8fafc;
}

.project-edit-form .image-grid figcaption,
.project-image-preview-item figcaption {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

.project-image-preview-remove,
.project-edit-form .image-grid button.mini-link-btn {
  margin-top: 8px !important;
}

.project-ops-stack {
  gap: 14px !important;
}

.project-ops-card {
  border-radius: 20px !important;
  padding: 16px !important;
}

.project-ops-card-head {
  margin-bottom: 13px !important;
  padding-bottom: 11px !important;
}

.project-ops-card-title {
  font-size: 15px !important;
}

.project-ops-card-sub {
  font-size: 12px !important;
}

.project-ops-card .project-check-item,
.project-notify-box-card .project-check-item {
  border-radius: 14px;
}

.project-submit-bar {
  margin-top: 28px !important;
  padding: 14px 12px !important;
}

.project-submit-btn {
  max-width: 480px !important;
  min-height: 50px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
}

@media (max-width: 700px) {
  .project-edit-page {
    padding: 4px 0 16px;
  }

  .project-edit-form {
    gap: 14px;
  }

  .project-edit-panel {
    border-radius: 18px !important;
    padding: 14px !important;
  }

  .project-edit-panel > h2 {
    font-size: 16px !important;
    margin-bottom: 13px !important;
  }

  .project-edit-form .form-grid.two {
    gap: 12px;
  }

  .project-dm-card {
    border-radius: 15px !important;
    padding: 12px !important;
  }

  .project-edit-form .image-grid figure,
  .project-image-preview-item {
    width: 124px;
    padding: 8px;
  }

  .project-edit-form .image-grid img,
  .project-image-preview-thumb {
    width: 124px;
    height: 84px;
  }

  .project-submit-bar {
    margin-top: 16px !important;
    padding: 10px 8px !important;
  }

  .project-submit-btn {
    max-width: 100% !important;
    min-height: 46px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
  }
}



/* ===== project detail design phase 1 ===== */

.project-detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 0 20px;
}

.project-detail-page .project-top-nav {
  margin-bottom: 14px;
}

.project-detail-page .project-top-nav .button.secondary {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.project-detail-page .project-hero-panel,
.project-detail-page .panel {
  border-radius: 20px !important;
  border: 1px solid #e5edf6 !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05) !important;
}

.project-detail-page .project-hero-panel {
  padding: 18px !important;
  margin-bottom: 18px;
}

.project-detail-page .panel {
  padding: 16px !important;
}

.project-detail-page .panel h2 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.project-detail-page .panel h2::after,
.project-detail-page .project-hero-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa 0%, #93c5fd 100%);
}

.project-detail-page .project-hero-head {
  gap: 16px;
}

.project-detail-page .project-hero-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.18;
  color: #0f172a;
}

.project-detail-page .project-hero-sub {
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
}

.project-detail-page .project-hero-actions {
  gap: 10px;
}

.project-detail-page .button-link,
.project-detail-page .secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
  background: #ffffff;
  color: #475569;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.project-detail-page .secondary-link {
  background: #f8fbff;
}

.page-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid > div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ebf0f6;
  background: #ffffff;
}

.detail-grid > div span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.detail-grid > div strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
  word-break: break-word;
}

.copy-block + .copy-block,
.text-block + .text-block {
  margin-top: 14px;
}

.copy-block label,
.text-block h3 {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.copy-block textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 14px;
  border: 1px solid #d9e3ef;
  background: #ffffff;
  padding: 12px 14px;
  line-height: 1.7;
  resize: vertical;
}

.copy-block button,
.project-detail-page .secondary {
  min-height: 36px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.text-block {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ebf0f6;
  background: #ffffff;
}

.text-block p,
.text-block ul {
  margin: 0;
  color: #475569;
  line-height: 1.7;
}

.text-block ul {
  padding-left: 18px;
}

.password-mask {
  letter-spacing: 0.08em;
}

.project-detail-page .image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.project-detail-page .image-grid figure {
  margin: 0;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e8eef5;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.project-detail-page .image-grid img {
  width: 148px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.project-detail-page .image-grid figcaption {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  word-break: break-all;
}

.project-detail-page .image-grid .button-link {
  margin-top: 8px;
}

@media (max-width: 700px) {
  .project-detail-page {
    padding: 4px 0 16px;
  }

  .project-detail-page .project-hero-panel,
  .project-detail-page .panel {
    border-radius: 18px !important;
    padding: 14px !important;
  }

  .project-detail-page .project-hero-head {
    flex-direction: column;
    align-items: stretch;
  }

  .project-detail-page .project-hero-actions {
    justify-content: flex-start;
  }

  .project-detail-page .project-hero-title {
    font-size: 22px;
  }

  .page-split,
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-detail-page .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-detail-page .image-grid img {
    width: 124px;
    height: 84px;
  }
}



/* ===== project list/detail flow refinement ===== */

.project-index-card.project-index-card-compact {
  min-height: auto;
}

.project-card-inner-compact {
  padding: 10px 12px;
}

.project-card-top-compact {
  margin-bottom: 0;
  align-items: center;
}

.project-card-client-compact {
  margin-top: 5px;
}

.project-card-link-layer {
  border-radius: 16px;
}

.project-hero-delete-form {
  margin: 0;
}

.project-detail-page .danger-link {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.project-detail-page .danger-link:hover {
  background: #ffecec;
}

.project-detail-page .text-block p {
  white-space: pre-wrap;
}

.project-detail-page .copy-block textarea {
  white-space: pre-wrap;
}

.copy-feedback-btn {
  min-width: 110px;
}

@media (max-width: 700px) {
  .project-card-inner-compact {
    padding: 10px;
  }

  .project-card-top-compact {
    align-items: flex-start;
  }
}



/* ===== project detail cleanup phase ===== */

.detail-dm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-dm-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e8eef5;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.detail-dm-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.detail-dm-body {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #475569;
}

.detail-copy-source {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.detail-toggle-btn {
  margin-top: 10px;
}

.project-detail-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.project-detail-bottom-delete-form {
  margin: 0;
}

.project-detail-page .text-block p {
  white-space: pre-wrap;
}

@media (max-width: 700px) {
  .detail-dm-card {
    padding: 12px;
    border-radius: 14px;
  }

  .project-detail-bottom-actions {
    justify-content: stretch;
  }
}



/* ===== project list click fix ===== */

.project-card-link-block {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-card-link-block:visited,
.project-card-link-block:hover,
.project-card-link-block:active {
  color: inherit;
  text-decoration: none;
}



/* ===== project detail back button fix ===== */

.project-detail-page .project-top-nav.project-top-nav-right {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.project-detail-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}

.project-detail-back-btn:hover {
  background: #f8fbff;
}

@media (max-width: 700px) {
  .project-detail-back-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 12px;
  }
}



/* ===== project list copy button ===== */

.project-list-inline-actions {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 10px;
}

.project-list-inline-actions form {
  margin: 0;
}

.project-list-inline-actions .mini-link-btn,
.project-list-inline-actions button,
.project-list-inline-actions a {
  position: relative;
  z-index: 6;
}

@media (max-width: 700px) {
  .project-list-inline-actions {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 9px 9px;
  }
}


/* ===== person edit checkbox inline fix ===== */
.form-grid label.checkbox,
.profile-edit-form label.checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 14px !important;
}

.form-grid label.checkbox input[type="checkbox"],
.profile-edit-form label.checkbox input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

/* ===== unified list action layout ===== */
.project-list-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.project-list-inline-actions form {
  margin: 0;
}

@media (max-width: 700px) {
  .project-list-inline-actions {
    padding: 0 12px 12px;
  }
}

/* ===== table UI fix ===== */
.custom-table th {
  position: static !important;
  background: #f8fafc;
}

.custom-table {
  min-width: 100% !important;
}

@media (max-width: 700px) {
  .custom-table th,
  .custom-table td {
    font-size: 13px !important;
    padding: 10px !important;
  }
}



/* ===== FIX: table action height ===== */
.table-actions form {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* ===== FIX: compact badge FINAL ===== */


/* ===== FIX: project row height ===== */
.custom-table-projects td {
  padding: 6px 8px !important;
}

/* ===== final list tune ===== */

/* ステータスバッジの高さを揃える */
.project-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 22px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* 操作まわりの高さを圧縮 */
.custom-table-projects .table-actions,
.custom-table-persons .table-actions,
.custom-table-clients .table-actions {
  min-height: 22px !important;
  align-items: center !important;
}

.custom-table-projects .table-actions form,
.custom-table-persons .table-actions form,
.custom-table-clients .table-actions form {
  display: inline !important;
  margin: 0 !important;
}

/* 行クリックの見え方を自然に */
.list-row-clickable td {
  transition: background-color 0.12s ease;
}

.list-row-clickable:hover td {
  background: #f8fbff !important;
}

/* ボタン押下を優先 */
.table-actions,
.table-actions a,
.table-actions button,
.table-actions form {
  position: relative;
  z-index: 4;
}

/* モバイル時の詰まりを少し整理 */
@media (max-width: 700px) {
  .custom-table-projects th,
  .custom-table-projects td,
  .custom-table-persons th,
  .custom-table-persons td,
  .custom-table-clients th,
  .custom-table-clients td {
    font-size: 12px !important;
    padding: 8px 6px !important;
  }

  .project-status-badge {
    min-height: 20px !important;
    padding: 0 7px !important;
    font-size: 10px !important;
  }

  .custom-table-projects td:nth-child(1) { width: 32%; }
  .custom-table-projects td:nth-child(2) { width: 28%; }
  .custom-table-projects td:nth-child(3) { width: 20%; }

  .custom-table-persons td:nth-child(1) { width: 30%; }
  .custom-table-persons td:nth-child(2) { width: 24%; }
  .custom-table-persons td:nth-child(3) { width: 18%; }
  .custom-table-persons td:nth-child(4) { width: 18%; }

  .custom-table-clients td:nth-child(1) { width: 28%; }
  .custom-table-clients td:nth-child(2) { width: 30%; }
  .custom-table-clients td:nth-child(3) { width: 18%; }
  .custom-table-clients td:nth-child(4) { width: 18%; }
}

/* ===== FINAL: 行の高さそのものを圧縮 ===== */

/* テーブル行の高さを強制的に詰める */
.custom-table td,
.custom-table th {
  height: 36px !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
}

/* 案件一覧はさらに詰める（コピーあるので） */
.custom-table-projects td {
  height: 32px !important;
}

/* 余計な余白を完全削除 */
.custom-table td > * {
  margin: 0 !important;
}

/* フォームが高さを押し広げるのを防ぐ */
.custom-table form {
  display: inline-flex !important;
  align-items: center !important;
  height: 100% !important;
}

/* ボタンの影響を完全排除 */

/* モバイル最終圧縮 */
@media (max-width: 700px) {
  .custom-table td,
  .custom-table th {
    height: 30px !important;
    padding: 6px 4px !important;
  }

  .custom-table-projects td {
    height: 28px !important;
  }
}



/* ===== compact copy button final ===== */
.compact-badge-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 24px !important;
  min-width: auto !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  border: 1px solid #d7dee2 !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

.compact-badge-btn:hover {
  background: #f8fafc !important;
}

.custom-table-projects .table-actions form {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

.custom-table-projects .table-actions .compact-badge-btn {
  vertical-align: middle !important;
}

@media (max-width: 700px) {
  .compact-badge-btn {
    height: 22px !important;
    padding: 0 7px !important;
    border-radius: 7px !important;
    font-size: 10px !important;
  }
}

/* ===== compact copy button link-like final ===== */
.compact-badge-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 18px !important;
  min-width: auto !important;
  padding: 0 4px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.compact-badge-btn:hover {
  background: transparent !important;
  color: #0f172a !important;
}

.custom-table-projects .table-actions form {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

.custom-table-projects .table-actions .compact-badge-btn {
  vertical-align: middle !important;
}

@media (max-width: 700px) {
  .compact-badge-btn {
    height: 16px !important;
    padding: 0 3px !important;
    font-size: 10px !important;
  }
}

/* ===== copy button clean minimal ===== */
.compact-badge-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.compact-badge-btn:hover {
  background: #eef2f7 !important;
  color: #0f172a !important;
}

@media (max-width: 700px) {
  .compact-badge-btn {
    height: 20px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
  }
}

/* ===== visual polish ===== */

/* ステータスバッジ（プロ風） */
.project-status-badge {
  border-radius: 999px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border: none !important;
}

/* 稼働中（薄グリーン） */
.project-status-badge.is-active {
  background: #ecfdf5 !important;
  color: #059669 !important;
}

/* 停止中（薄グレー） */
.project-status-badge.is-stop {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

/* 終了（薄レッド） */
.project-status-badge.is-end {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

/* テーブル全体を少し柔らかく */
.custom-table {
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

/* 行の区切りを薄く */
.custom-table td {
  border-bottom: 1px solid #f1f5f9 !important;
}

/* ホバーを自然に */
.list-row-clickable:hover td {
  background: #f8fafc !important;
}

/* ヘッダーボタンを少し高級感出す */
.header-mini-btn {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

.header-mini-btn:hover {
  background: #eef2f7 !important;
}

/* コピーとの統一感アップ */
.compact-badge-btn {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

.compact-badge-btn:hover {
  background: #eef2f7 !important;
}


/* ===== table premium polish ===== */

/* ヘッダー行（ここが一番重要） */
.custom-table th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* セル全体 */
.custom-table td {
  font-size: 13px !important;
  color: #0f172a !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

/* 行ホバー（うっすら） */
.list-row-clickable:hover td {
  background: #f9fbfd !important;
}

/* 最後の行だけ線消す（綺麗に見える） */
.custom-table tr:last-child td {
  border-bottom: none !important;
}

/* テーブル全体の質感 */
.custom-table {
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

/* 列の余白調整（詰めすぎ防止） */
.custom-table th,
.custom-table td {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* ステータスバッジを少しだけ締める */
.project-status-badge {
  padding: 0 7px !important;
  font-size: 11px !important;
}

/* コピーとのバランス調整 */
.compact-badge-btn {
  margin-left: 4px !important;
}


/* ===== font polish ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.custom-table td {
  font-weight: 500;
}


/* ===== clickable UX polish ===== */
.list-row-clickable {
  cursor: pointer;
}

.list-row-clickable:active td {
  background: #eef4ff !important;
}


/* ===== table visual hierarchy ===== */

/* ヘッダーを少しだけ強く */
.custom-table th {
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* 1列目を主役にする */
.custom-table td:first-child {
  font-weight: 600 !important;
  color: #0f172a !important;
}

/* サブ情報を弱く */
.custom-table td:not(:first-child) {
  color: #475569;
}


.project-status-badge.is-active {
  background: #ecfdf5 !important;
  color: #065f46 !important;
}

.project-status-badge.is-stop {
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.project-status-badge.is-end {
  background: #f1f5f9 !important;
  color: #334155 !important;
}


/* ===== project detail text restore ===== */
.project-detail-prewrap {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  line-height: 1.7 !important;
}

.project-detail-text-item .mypage-menu-main {
  width: 100%;
}

.project-detail-copy-btn {
  margin-top: 10px !important;
  align-self: flex-start;
}

.project-detail-image-wrap {
  padding: 12px;
  background: #fff;
}

/* ===== analytics count table mobile UI ===== */
.analytics-table-page {
  width: 100%;
}

.analytics-kpi-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.analytics-count-table {
  min-width: 620px !important;
}

.analytics-count-table th,
.analytics-count-table td {
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.analytics-count-table .num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.analytics-project-name,
.analytics-person-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-status-badge.is-done {
  background: #ecfdf5;
  color: #065f46;
}

.analytics-status-badge.is-ng {
  background: #fef2f2;
  color: #991b1b;
}

.analytics-status-badge.is-carry {
  background: #fff7ed;
  color: #9a3412;
}

.analytics-status-badge.is-neutral {
  background: #f1f5f9;
  color: #475569;
}

@media (max-width: 700px) {
  .analytics-date-form {
    gap: 6px !important;
  }

  .analytics-nav-btn,
  .analytics-date-input {
    font-size: 12px !important;
    min-height: 32px !important;
    padding: 0 8px !important;
  }

  .analytics-kpi-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .analytics-kpi-card {
    padding: 10px !important;
  }

  .analytics-kpi-label {
    font-size: 11px !important;
  }

  .analytics-kpi-value {
    font-size: 18px !important;
  }

  .analytics-count-table {
    min-width: 560px !important;
  }

  .analytics-count-table th,
  .analytics-count-table td {
    font-size: 11px !important;
    padding: 7px 6px !important;
  }

  .analytics-project-name {
    max-width: 110px;
  }

  .analytics-person-name {
    max-width: 80px;
  }

  .analytics-status-badge {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }
}


/* ===== analytics date selector fixed single source ===== */
.analytics-date-panel {
  width: 100%;
  margin-bottom: 12px;
}

.analytics-date-form-clean {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: 42px minmax(118px, 132px) 42px 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: visible !important;
}

.analytics-date-form-clean .header-mini-btn {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 32px !important;
  padding: 0 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.analytics-date-input-clean {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 132px !important;
  height: 32px !important;
  padding: 0 6px !important;
  border: 1px solid #d7dee2 !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-sizing: border-box !important;
  appearance: auto !important;
}

@media (max-width: 360px) {
  .analytics-date-form-clean {
    max-width: 320px;
    grid-template-columns: 36px minmax(112px, 118px) 40px 36px;
    gap: 4px;
    padding: 7px;
  }

  .analytics-date-form-clean .header-mini-btn {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    font-size: 11px !important;
  }

  .analytics-date-input-clean {
    max-width: 118px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
  }
}

/* ===== FINAL analytics mobile fit ===== */
.analytics-table-page {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.analytics-date-panel {
  width: 100% !important;
  margin: 0 0 12px !important;
}

.analytics-date-form-clean {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 52px 40px !important;
  gap: 6px !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  border-radius: 14px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  overflow: hidden !important;
}

.analytics-date-btn {
  height: 34px !important;
  min-width: 0 !important;
  width: 100% !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #f8fafc !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.analytics-date-submit {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}

.analytics-date-input-clean {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 34px !important;
  padding: 0 6px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.analytics-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.analytics-count-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.analytics-count-table .col-project { width: 25%; }
.analytics-count-table .col-person { width: 20%; }
.analytics-count-table .col-count { width: 12%; }
.analytics-count-table .col-total { width: 12%; }
.analytics-count-table .col-remain { width: 15%; }
.analytics-count-table .col-status { width: 16%; }

.analytics-count-table th,
.analytics-count-table td {
  font-size: 11px !important;
  padding: 8px 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

.analytics-count-table .num {
  text-align: right !important;
}

.analytics-project-name,
.analytics-person-name {
  max-width: none !important;
}

.analytics-status-badge {
  min-height: 20px !important;
  padding: 0 5px !important;
  font-size: 10px !important;
  max-width: 100% !important;
}

@media (max-width: 380px) {
  .analytics-date-form-clean {
    grid-template-columns: 34px minmax(0, 1fr) 46px 34px !important;
    gap: 4px !important;
    padding: 7px !important;
  }

  .analytics-date-btn,
  .analytics-date-input-clean {
    height: 32px !important;
    font-size: 11px !important;
  }

  .analytics-count-table th,
  .analytics-count-table td {
    font-size: 10px !important;
    padding: 7px 3px !important;
  }
}

/* ===== analytics table final alignment ===== */
.analytics-table-wrap {
  padding: 0 !important;
  overflow-x: hidden !important;
}

.analytics-count-table {
  width: 100% !important;
  table-layout: fixed !important;
}

.analytics-count-table .col-project { width: 24%; }
.analytics-count-table .col-person { width: 22%; }
.analytics-count-table .col-count { width: 12%; }
.analytics-count-table .col-total { width: 12%; }
.analytics-count-table .col-remain { width: 15%; }
.analytics-count-table .col-status { width: 15%; }

.analytics-count-table th,
.analytics-count-table td {
  text-align: left !important;
  vertical-align: middle !important;
}

.analytics-count-table th:nth-child(3),
.analytics-count-table th:nth-child(4),
.analytics-count-table th:nth-child(5),
.analytics-count-table td.num {
  text-align: right !important;
}

.analytics-count-table th:nth-child(6),
.analytics-count-table td:nth-child(6) {
  text-align: center !important;
}

.analytics-merged-cell {
  vertical-align: middle !important;
  background: #ffffff !important;
  border-right: 1px solid #f1f5f9 !important;
}

.analytics-project-name,
.analytics-person-name {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

@media (max-width: 700px) {
  .analytics-count-table th,
  .analytics-count-table td {
    padding: 8px 3px !important;
    font-size: 11px !important;
  }

  .analytics-status-badge {
    padding: 0 4px !important;
    font-size: 10px !important;
  }
}

/* ===== analytics date clean FINAL (override) ===== */
.analytics-date-panel {
  margin: 10px 0 !important;
  padding: 0 10px !important;
}

.analytics-date-form-clean {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.analytics-date-form-clean .header-mini-btn {
  flex: 0 0 auto !important;
}

.analytics-date-input-clean {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 36px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #f8fafc !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
}

/* スマホ */
@media (max-width: 700px) {
  .analytics-date-form-clean {
    gap: 4px !important;
  }

  .analytics-date-input-clean {
    font-size: 13px !important;
    height: 32px !important;
  }

  .analytics-date-form-clean .header-mini-btn {
    padding: 0 6px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
}


/* ===== analytics prev next button fix ===== */
.analytics-date-mini-btn {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  border: 1px solid #d7dee2 !important;
  background: #f8fafc !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.analytics-date-mini-btn:hover {
  background: #eef2f7 !important;
}

.analytics-date-form-clean {
  grid-template-columns: 40px minmax(150px, 1fr) 40px !important;
}

@media (max-width: 380px) {
  .analytics-date-mini-btn {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 30px !important;
    font-size: 11px !important;
  }

  .analytics-date-form-clean {
    grid-template-columns: 36px minmax(140px, 1fr) 36px !important;
  }
}

/* ===== analytics table polish ===== */
.analytics-table-wrap {
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

.analytics-count-table {
  border: none !important;
  box-shadow: none !important;
}

.analytics-count-table thead th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.analytics-count-table tbody td {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

.analytics-count-table tbody tr:last-child td {
  border-bottom: none !important;
}

.analytics-project-name {
  font-weight: 800 !important;
  color: #111827 !important;
}

.analytics-person-name {
  font-weight: 600 !important;
  color: #334155 !important;
}

.analytics-count-table .num {
  font-weight: 800 !important;
  color: #111827 !important;
}

.analytics-merged-cell {
  background: #ffffff !important;
}

.analytics-status-badge {
  border-radius: 999px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
}

.analytics-status-badge.is-done {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

.analytics-status-badge.is-ng {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.analytics-status-badge.is-carry {
  background: #fff7ed !important;
  color: #c2410c !important;
}

.analytics-status-badge.is-neutral {
  background: #f1f5f9 !important;
  color: #475569 !important;
}

/* 案件グループの境界を少しだけ強調 */
.analytics-count-table tr:has(.analytics-project-name) td {
  border-top: 1px solid #e2e8f0 !important;
}

.analytics-count-table tbody tr:first-child td {
  border-top: none !important;
}

@media (max-width: 700px) {
  .analytics-table-wrap {
    border-radius: 12px !important;
  }

  .analytics-count-table th,
  .analytics-count-table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .analytics-count-table thead th {
    font-size: 10px !important;
  }

  .analytics-project-name {
    font-size: 10.5px !important;
  }

  .analytics-person-name,
  .analytics-count-table .num {
    font-size: 11px !important;
  }

  .analytics-status-badge {
    min-height: 19px !important;
    padding: 0 5px !important;
    font-size: 9.5px !important;
  }
}

/* ===== analytics align balance ===== */
.analytics-count-table th {
  text-align: center !important;
}

/* テキスト系は左 */
.analytics-project-name,
.analytics-person-name {
  text-align: left !important;
}

/* 数値と状態は中央 */
.analytics-count-table .num {
  text-align: center !important;
}

.analytics-count-table td:nth-child(6) {
  text-align: center !important;
}

/* 視線ガイド用に少し間を作る */
.analytics-count-table td {
  letter-spacing: 0.02em;
}


/* ===== analytics ALL center ===== */
.analytics-count-table th,
.analytics-count-table td {
  text-align: center !important;
}

/* 案件名も中央にする代わりに強調 */
.analytics-project-name {
  font-weight: 800 !important;
  letter-spacing: 0.02em;
}

/* 担当者は少し弱く */
.analytics-person-name {
  font-weight: 600 !important;
  opacity: 0.9;
}

/* 数値は一番目立たせる */
.analytics-count-table .num {
  font-weight: 900 !important;
  font-variant-numeric: tabular-nums;
}

/* 状態バッジ中央 */
.analytics-status-badge {
  margin: 0 auto !important;
}

/* 行間ちょい広げて見やすく */
.analytics-count-table td {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}


/* ===== analytics project group separation ===== */

/* 偶数グループ */
.analytics-row-even td {
  background: #fafbfc;
}

/* 奇数グループ */
.analytics-row-odd td {
  background: #ffffff;
}

/* グループ切り替わりの上に境界線 */
.analytics-group-start td {
  border-top: 2px solid #e2e8f0 !important;
}

/* ホバーで軽く浮かせる */
.analytics-count-table tr:hover td {
  background: #f1f5f9 !important;
  transition: 0.15s;
}


/* ===== analytics project group separation ===== */

.analytics-row-even td {
  background: #fafbfc;
}

.analytics-row-odd td {
  background: #ffffff;
}

.analytics-group-start td {
  border-top: 2px solid #e2e8f0 !important;
}

.analytics-count-table tr:hover td {
  background: #f1f5f9 !important;
  transition: 0.15s;
}


/* ===== analytics final design polish ===== */

.analytics-table-page {
  padding-top: 4px !important;
}

/* 日付バー */
.analytics-date-panel {
  margin: 4px 0 14px !important;
}

.analytics-date-form-clean {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
}

.analytics-date-mini-btn {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

.analytics-date-mini-btn:hover {
  background: #f1f5f9 !important;
}

.analytics-date-input-clean {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* 表全体 */
.analytics-table-wrap {
  border-radius: 16px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
}

/* ヘッダー */
.analytics-count-table thead th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* セル */
.analytics-count-table tbody td {
  border-bottom: 1px solid #f1f5f9 !important;
}

/* 案件グループ境界 */
.analytics-group-start td {
  border-top: 3px solid #e8edf3 !important;
}

.analytics-count-table tbody tr:first-child td {
  border-top: none !important;
}

/* 案件名セル */
.analytics-merged-cell.analytics-project-name {
  background: #f8fafc !important;
  border-right: 1px solid #e2e8f0 !important;
  font-weight: 900 !important;
}

/* 担当者名 */
.analytics-person-name {
  color: #334155 !important;
  font-weight: 700 !important;
}

/* 数値 */
.analytics-count-table .num {
  color: #0f172a !important;
  font-weight: 900 !important;
}

/* 状態バッジ */
.analytics-status-badge {
  min-width: 42px !important;
  border-radius: 999px !important;
  font-weight: 900 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5) !important;
}

/* hover */
.analytics-count-table tbody tr:hover td {
  background: #f8fafc !important;
}

/* セクションの余白を詰める */
.analytics-table-page .mypage-section {
  margin-top: 0 !important;
}

@media (max-width: 700px) {
  .analytics-date-form-clean {
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
  }

  .analytics-table-wrap {
    border-radius: 14px !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05) !important;
  }

  .analytics-count-table th,
  .analytics-count-table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .analytics-status-badge {
    min-width: 38px !important;
  }
}


/* ===== emphasis important numbers ===== */
.analytics-count-table td:nth-child(3),
.analytics-count-table td:nth-child(4),
.analytics-count-table td:nth-child(5) {
  font-size: 13px !important;
  font-weight: 900 !important;
  color: #0f172a !important;
}


.analytics-status-badge.is-done {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.analytics-status-badge.is-ng {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
}

.analytics-status-badge.is-carry {
  background: #ffedd5 !important;
  color: #9a3412 !important;
}


/* ===== smooth horizontal scroll ===== */
.analytics-table-wrap {
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}


/* ===== analytics sort buttons ===== */
.analytics-sort-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: center;
}

.sort-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  text-decoration: none;
  font-weight: 700;
}

.sort-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.sort-btn:hover {
  background: #e2e8f0;
}


/* ===== analytics date + sort one line ===== */
.analytics-date-sort-form {
  grid-template-columns: 38px minmax(118px, 1fr) minmax(96px, 1.05fr) 38px !important;
  gap: 5px !important;
  padding: 7px !important;
}

.analytics-sort-select {
  width: 100% !important;
  min-width: 0 !important;
  height: 32px !important;
  padding: 0 6px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  box-sizing: border-box !important;
  appearance: auto !important;
}

.analytics-date-sort-form .analytics-date-mini-btn {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
}

.analytics-date-sort-form .analytics-date-input-clean {
  min-width: 0 !important;
  width: 100% !important;
  font-size: 12px !important;
}

@media (max-width: 380px) {
  .analytics-date-sort-form {
    grid-template-columns: 34px minmax(106px, 1fr) minmax(86px, 0.95fr) 34px !important;
    gap: 4px !important;
    padding: 6px !important;
  }

  .analytics-sort-select {
    height: 30px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
  }

  .analytics-date-sort-form .analytics-date-mini-btn {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
  }

  .analytics-date-sort-form .analytics-date-input-clean {
    font-size: 11px !important;
    padding: 0 4px !important;
  }
}

/* ===== analytics date sort order adjusted ===== */
.analytics-date-sort-form {
  grid-template-columns: 38px minmax(118px, 1fr) 38px minmax(96px, 1.05fr) !important;
}

@media (max-width: 380px) {
  .analytics-date-sort-form {
    grid-template-columns: 34px minmax(106px, 1fr) 34px minmax(86px, 0.95fr) !important;
  }
}


/* ===== analytics UI improve ===== */

/* 案件ごと区切り */
.analytics-group-start td {
  border-top: 2px solid #e5e7eb;
}

/* 数字強調 */
.analytics-count-table .num {
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* 残り件数を目立たせる */
.analytics-count-table td:nth-child(5) {
  color: #b91c1c;
  font-weight: 800;
}


/* ===== FORCE payroll redesign ===== */

.payroll-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px;
}

.payroll-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin-bottom: 12px;
}

.payroll-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  text-decoration: none;
}

.pay-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
}

.pay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pay-name {
  font-weight: 900;
  font-size: 15px;
}

.pay-sub {
  font-size: 11px;
  color: #64748b;
}

.pay-total {
  font-size: 18px;
  font-weight: 900;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  margin-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.pay-grid div {
  text-align: center;
  padding: 8px 4px;
}

.pay-grid span {
  font-size: 10px;
  color: #64748b;
}

.pay-grid strong {
  display: block;
  margin-top: 3px;
}

.pay-grid .minus {
  color: #dc2626;
}

.pay-detail {
  margin-top: 10px;
}

.pay-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 5px;
}

/* ← 既存デザイン無効化 */
.subrow { display:none !important; }


/* ===== analytics table center fix ===== */
.analytics-table-wrap {
  display: flex;
  justify-content: center;
}

.analytics-count-table {
  margin: 0 auto;
  width: auto;
  min-width: 600px;
}

/* PC時はちょうどいい幅に制限 */
@media (min-width: 900px) {
  .analytics-count-table {
    width: 90%;
    max-width: 900px;
  }
}


/* ===== analytics table restore ===== */
.analytics-count-table {
  width: 100%;
  border-collapse: collapse;
}


/* ===== payroll FINAL UI ===== */

.payroll-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 10px;
}

.payroll-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin-bottom: 12px;
}

.payroll-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  text-decoration: none;
}

.pay-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 14px rgba(0,0,0,0.05);
}

.pay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pay-name {
  font-weight: 900;
  font-size: 15px;
}

.pay-sub {
  font-size: 11px;
  color: #64748b;
}

.pay-total {
  font-size: 20px;
  font-weight: 900;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  margin-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.pay-grid div {
  text-align: center;
  padding: 8px 4px;
}

.pay-grid span {
  font-size: 10px;
  color: #64748b;
}

.pay-grid strong {
  display: block;
  margin-top: 3px;
}

.minus {
  color: #dc2626;
}

.pay-detail {
  margin-top: 10px;
}

.pay-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 6px;
}


/* ===== restore analytics merged cells ===== */
.analytics-merged-cell {
  vertical-align: middle !important;
  text-align: center !important;
  background: #f8fafc !important;
  border-right: 1px solid #e2e8f0 !important;
}

.analytics-project-name {
  font-weight: 900 !important;
  color: #0f172a !important;
}

.analytics-person-name {
  text-align: center !important;
}


/* ===== analytics rowspan stable final ===== */
.analytics-count-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
}

.analytics-merged-cell {
  vertical-align: middle !important;
  text-align: center !important;
  background: #f8fafc !important;
  border-right: 1px solid #e2e8f0 !important;
}

.analytics-project-name {
  font-weight: 900 !important;
  color: #0f172a !important;
}

.analytics-person-name,
.analytics-count-table .num,
.analytics-count-table th,
.analytics-count-table td {
  text-align: center !important;
}

.analytics-date-form-clean {
  grid-template-columns: 40px minmax(150px, 1fr) 40px !important;
}


/* ===== shared date navigation UI ===== */
.date-nav-panel {
  width: 100% !important;
  margin: 6px 0 12px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.date-nav-bar {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
  box-sizing: border-box !important;
}

.date-nav-btn {
  width: 40px !important;
  min-width: 40px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.date-nav-value {
  width: 100% !important;
  min-width: 0 !important;
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.date-nav-date {
  appearance: auto !important;
}

.payroll-date-bar,
.analytics-date-form-clean.date-nav-bar {
  max-width: 420px !important;
  margin: 0 auto !important;
}

@media (max-width: 380px) {
  .date-nav-bar {
    grid-template-columns: 36px minmax(0, 1fr) 36px !important;
    gap: 4px !important;
    padding: 7px !important;
  }

  .date-nav-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 30px !important;
    font-size: 11px !important;
  }

  .date-nav-value {
    height: 30px !important;
    font-size: 12px !important;
    padding: 0 6px !important;
  }
}


/* ===== shared date nav FINAL ===== */
.date-nav-panel {
  width: 100% !important;
  max-width: 420px !important;
  margin: 6px auto 12px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.date-nav-bar {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
  box-sizing: border-box !important;
}

.date-nav-btn {
  width: 40px !important;
  min-width: 40px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.date-nav-value {
  width: 100% !important;
  min-width: 0 !important;
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  border: 1px solid #d7dee2 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.date-nav-input {
  appearance: auto !important;
}

@media (max-width: 380px) {
  .date-nav-panel {
    max-width: 100% !important;
  }

  .date-nav-bar {
    grid-template-columns: 36px minmax(0, 1fr) 36px !important;
    gap: 4px !important;
    padding: 7px !important;
  }

  .date-nav-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 30px !important;
    font-size: 12px !important;
  }

  .date-nav-value {
    height: 30px !important;
    font-size: 12px !important;
    padding: 0 6px !important;
  }
}


/* ===== footer 4 menu fix ===== */
.app-footer,
.footer-nav,
.bottom-nav {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  align-items: center !important;
}

.app-footer a,
.footer-nav a,
.bottom-nav a {
  text-align: center !important;
  font-size: 12px !important;
  padding: 6px 0 !important;
}

/* アイコン+テキスト系のズレ防止 */
.app-footer a span,
.footer-nav a span,
.bottom-nav a span {
  display: block !important;
  font-size: 10px !important;
}

/* 押しやすさ */
.app-footer a,
.footer-nav a,
.bottom-nav a {
  min-height: 48px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}


/* ===== x bottombar 4 menu fix ===== */
.x-bottombar-inner {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  align-items: center !important;
  gap: 0 !important;
}

.x-bottombar-inner a {
  min-width: 0 !important;
  width: 100% !important;
  min-height: 48px !important;
  padding: 6px 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  box-sizing: border-box !important;
}


/* ===== analytics visual polish ===== */

.analytics-table-page {
  max-width: 980px !important;
  margin: 0 auto !important;
  padding: 8px 10px 86px !important;
}

.analytics-table-wrap {
  border-radius: 18px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07) !important;
}

.analytics-count-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
}

.analytics-count-table thead th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  padding: 10px 4px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.analytics-count-table tbody td {
  padding: 11px 5px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #334155 !important;
}

.analytics-count-table tbody tr:last-child td {
  border-bottom: none !important;
}

.analytics-merged-cell {
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 900 !important;
}

.analytics-project-name {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.analytics-person-name {
  color: #1e293b !important;
  font-weight: 800 !important;
}

.analytics-count-table .num {
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  font-variant-numeric: tabular-nums !important;
}

.analytics-count-table td:nth-child(5),
.analytics-count-table .analytics-merged-cell:nth-child(5) {
  color: #b91c1c !important;
}

.analytics-status-badge {
  min-width: 42px !important;
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.analytics-status-badge.is-done {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.analytics-status-badge.is-ng {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.analytics-status-badge.is-carry {
  background: #ffedd5 !important;
  color: #9a3412 !important;
}

.analytics-status-badge.is-neutral {
  background: #f1f5f9 !important;
  color: #475569 !important;
}

.analytics-count-table tbody tr:hover td {
  background: #f8fafc !important;
}

@media (max-width: 700px) {
  .analytics-table-page {
    padding: 6px 6px 82px !important;
  }

  .analytics-table-wrap {
    border-radius: 16px !important;
  }

  .analytics-count-table thead th {
    font-size: 10px !important;
    padding: 8px 2px !important;
  }

  .analytics-count-table tbody td {
    font-size: 11px !important;
    padding: 9px 3px !important;
  }

  .analytics-project-name {
    font-size: 11px !important;
  }

  .analytics-count-table .num {
    font-size: 12px !important;
  }

  .analytics-status-badge {
    min-width: 38px !important;
    height: 22px !important;
    font-size: 10px !important;
    padding: 0 6px !important;
  }
}


/* ===== 表示合計 ===== */
.counter-visible-total {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f1f5f9;
  white-space: nowrap;
}

/* スマホ時少し小さく */
@media (max-width: 480px) {
  .counter-visible-total {
    font-size: 11px;
    padding: 4px 6px;
  }
}


/* ===== 表示合計 UI 調整 ===== */
.counter-visible-total {
  font-size: 16px !important;   /* 少し大きく */
  font-weight: 700 !important;
  color: #222 !important;
  margin-left: auto !important;
  padding-left: 8px !important;
  white-space: nowrap !important;
}

/* スマホでさらに見やすく */
@media (max-width: 480px) {
  .counter-visible-total {
    font-size: 18px !important;
  }
}

/* ===== カード圧縮（機能は維持） ===== */

/* カード余白削減 */
.counter-card.counter-card-arcade {
  padding: 10px 12px !important;
}

/* タイトル周り詰める */
.counter-arcade-head {
  margin-bottom: 4px !important;
}

/* ボタンエリア圧縮 */
.counter-arcade-row-main {
  gap: 6px !important;
}

/* 数字ボタン少し小さく */
.counter-arcade-number-button {
  padding: 6px 10px !important;
}

.counter-arcade-number {
  font-size: 22px !important;
}

/* +/-ボタン縮小 */
.counter-arcade-round-btn,
.counter-arcade-sub-btn {
  padding: 6px 8px !important;
  font-size: 14px !important;
}

/* ===== 進捗エリア横並び化 ===== */
.counter-arcade-foot.compact-progress {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-top: 6px !important;
}

/* 1行にまとめる */
.compact-progress-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 13px !important;
}

/* ラベル小さく */
.compact-progress-left strong {
  font-size: 12px !important;
  margin-right: 4px !important;
}

/* 数値を詰める */
.compact-progress-left span {
  font-size: 13px !important;
}

/* 残り件数 */
.compact-progress-right {
  font-size: 13px !important;
}

/* バーを細く */
.counter-arcade-progress-bar {
  height: 2px !important;
  margin-top: 2px !important;
}

/* スマホ最適化 */
@media (max-width: 480px) {

  .counter-card.counter-card-arcade {
    padding: 8px 10px !important;
  }

  .counter-arcade-number {
    font-size: 20px !important;
  }

  .compact-progress-top {
    font-size: 12px !important;
  }

}

/* ===== payroll detail breakdown ===== */
.pay-detail-card {
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.pay-detail-summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.pay-detail-summary::-webkit-details-marker {
  display: none;
}

.pay-detail-card[open] .pay-detail-summary {
  margin-bottom: 12px;
}

.pay-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-detail-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.pay-detail-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.pay-detail-date {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
  white-space: nowrap;
}

.pay-detail-amount {
  font-size: 15px;
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
}

.pay-detail-project {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  line-height: 1.4;
  margin-bottom: 10px;
  word-break: break-word;
}

.pay-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pay-detail-grid div {
  min-width: 0;
  border-radius: 10px;
  background: #f9fafb;
  padding: 8px;
}

.pay-detail-grid span {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.pay-detail-grid strong {
  display: block;
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .pay-detail-grid {
    grid-template-columns: 1fr;
  }

  .pay-detail-top {
    align-items: flex-start;
  }
}

/* ===== payroll detail table ===== */
.pay-detail-table-box {
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.pay-detail-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pay-detail-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pay-detail-table th,
.pay-detail-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.pay-detail-table th {
  color: #6b7280;
  font-weight: 800;
  background: #f9fafb;
}

.pay-detail-table .project-name {
  white-space: normal;
  word-break: break-word;
}

.pay-detail-table th:nth-child(1),
.pay-detail-table td:nth-child(1) {
  width: 96px;
}

.pay-detail-table th:nth-child(3),
.pay-detail-table td:nth-child(3) {
  width: 70px;
  text-align: right;
}

.pay-detail-table th:nth-child(4),
.pay-detail-table td:nth-child(4) {
  width: 86px;
  text-align: right;
}

.pay-detail-table th:nth-child(5),
.pay-detail-table td:nth-child(5) {
  width: 100px;
  text-align: right;
  font-weight: 800;
}

/* ===== payroll matrix detail table ===== */
.pay-detail-matrix {
  min-width: 720px;
  table-layout: auto;
}

.pay-detail-matrix th,
.pay-detail-matrix td {
  text-align: center;
}

.pay-detail-matrix th:first-child,
.pay-detail-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 160px;
  text-align: left;
  background: #fff;
}

.pay-detail-matrix th:first-child {
  background: #f9fafb;
}

.pay-detail-matrix .project-name {
  white-space: normal;
  word-break: break-word;
  font-weight: 800;
}

/* ===== payroll matrix fit override ===== */
.pay-detail-table-wrap {
  overflow-x: visible !important;
}

.pay-detail-matrix {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.pay-detail-matrix th,
.pay-detail-matrix td {
  padding: 8px 3px !important;
  font-size: 11px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.pay-detail-matrix th:first-child,
.pay-detail-matrix td:first-child {
  position: static !important;
  width: 30% !important;
  min-width: 0 !important;
  max-width: 30% !important;
  text-align: left !important;
  background: #fff !important;
  font-weight: 800 !important;
  word-break: break-word !important;
  white-space: normal !important;
}

.pay-detail-matrix th:not(:first-child),
.pay-detail-matrix td:not(:first-child) {
  width: 10% !important;
}

/* ===== 日付列見えるようにする（強制） ===== */
.pay-detail-table-wrap {
  overflow-x: auto !important;
}

.pay-detail-matrix {
  min-width: 700px !important;
}


/* ===== payroll matrix grid final ===== */
.pay-detail-grid-box {
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.pay-matrix {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(88px, 1.6fr) repeat(7, minmax(34px, 0.7fr));
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pay-matrix-head,
.pay-matrix-project,
.pay-matrix-count {
  padding: 9px 4px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  line-height: 1.25;
}

.pay-matrix-head {
  background: #f9fafb;
  color: #374151;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.pay-matrix-project {
  font-weight: 900;
  color: #111827;
  word-break: break-word;
  background: #fff;
}

.pay-matrix-count {
  text-align: center;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .pay-matrix {
    grid-template-columns: minmax(78px, 1.5fr) repeat(7, minmax(30px, 0.7fr));
  }

  .pay-matrix-head,
  .pay-matrix-project,
  .pay-matrix-count {
    font-size: 11px;
    padding: 8px 2px;
  }
}

/* ===== history page mobile cleanup ===== */
.history-filter-bar {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
}

.history-filter-bar select,
.history-filter-bar input,
.history-filter-bar button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 34px !important;
  padding: 0 6px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.history-filter-bar input[type="date"] {
  flex-basis: 112px !important;
  max-width: 122px !important;
}

.history-filter-bar button {
  flex: 0 0 52px !important;
}

.history-table-wrap {
  overflow-x: hidden !important;
  margin-top: 0 !important;
}

.history-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.history-table th,
.history-table td {
  padding: 7px 4px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 38% !important;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 24% !important;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 22% !important;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 16% !important;
  text-align: right !important;
}

/* ===== history header final fix ===== */
.history-table-wrap {
  width: 100% !important;
  overflow-x: hidden !important;
}

.history-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.history-table thead,
.history-table tbody,
.history-table tr {
  display: table-header-group;
}

.history-table tbody {
  display: table-row-group !important;
}

.history-table tr {
  display: table-row !important;
}

.history-table th,
.history-table td {
  display: table-cell !important;
  position: static !important;
  float: none !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  padding: 6px 3px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
}

.history-table th {
  font-size: 10px !important;
  font-weight: 700 !important;
  text-align: left !important;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 28% !important;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 28% !important;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 26% !important;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 18% !important;
  text-align: right !important;
}

/* ===== history header final fix ===== */
.history-table-wrap {
  width: 100% !important;
  overflow-x: hidden !important;
}

.history-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.history-table thead,
.history-table tbody,
.history-table tr {
  display: table-header-group;
}

.history-table tbody {
  display: table-row-group !important;
}

.history-table tr {
  display: table-row !important;
}

.history-table th,
.history-table td {
  display: table-cell !important;
  position: static !important;
  float: none !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  padding: 6px 3px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
}

.history-table th {
  font-size: 10px !important;
  font-weight: 700 !important;
  text-align: left !important;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 28% !important;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 28% !important;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 26% !important;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 18% !important;
  text-align: right !important;
}

/* ===== history delta color ===== */
.history-table td.plus {
  color: #16a34a !important;
  font-weight: 700 !important;
}

.history-table td.minus {
  color: #dc2626 !important;
  font-weight: 700 !important;
}

/* ===== history delta color final ===== */
.history-table td.delta-cell {
  font-weight: 800 !important;
}

.history-table td.delta-plus {
  color: #16a34a !important;
}

.history-table td.delta-minus {
  color: #dc2626 !important;
}

.history-table td.delta-zero {
  color: #64748b !important;
}

/* ===== history UI upgrade ===== */

.history-table tr {
  border-bottom: 1px solid #f1f5f9 !important;
}

.history-table td {
  vertical-align: middle !important;
}

/* 案件・担当者強調 */
.history-table td:nth-child(2) {
  font-weight: 700 !important;
}

.history-table td:nth-child(3) {
  color: #475569 !important;
  font-size: 12px !important;
}

/* ===== delta badge ===== */

.delta-cell {
  text-align: right !important;
}

.delta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

/* + */
.delta-plus {
  background: #dcfce7;
  color: #166534 !important;
}

/* - */
.delta-minus {
  background: #fee2e2;
  color: #991b1b !important;
}

/* 0 */
.delta-zero {
  background: #e2e8f0;
  color: #475569 !important;
}


/* ===== history page polish ===== */
.history-filter-bar {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  padding: 8px !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06) !important;
}

.history-filter-bar select,
.history-filter-bar input,
.history-filter-bar button {
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

.history-filter-bar button {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
}

.history-table-wrap {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
  overflow: hidden !important;
}

.history-table thead th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

.history-table tbody tr {
  background: #ffffff !important;
}

.history-table tbody tr:nth-child(even) {
  background: #fbfdff !important;
}

.history-table td {
  border-bottom: 1px solid #f1f5f9 !important;
}

.history-table tbody tr:last-child td {
  border-bottom: none !important;
}

.history-table td:nth-child(1) {
  color: #64748b !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
}

.history-table td:nth-child(2) {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.history-table td:nth-child(3) {
  color: #475569 !important;
  font-weight: 700 !important;
}

.delta-cell {
  text-align: right !important;
}

.delta-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-width: 52px !important;
  padding: 5px 8px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
}

.delta-plus {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}

.delta-minus {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
}

.delta-zero {
  background: #e2e8f0 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.history-empty {
  text-align: center !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  padding: 22px 8px !important;
}

@media (max-width: 420px) {
  .history-filter-bar {
    gap: 4px !important;
    padding: 6px !important;
  }

  .history-filter-bar select,
  .history-filter-bar input,
  .history-filter-bar button {
    height: 32px !important;
    font-size: 10px !important;
    padding: 0 4px !important;
  }

  .history-filter-bar input[type="date"] {
    flex-basis: 104px !important;
    max-width: 108px !important;
  }

  .history-filter-bar button {
    flex-basis: 46px !important;
  }

  .history-table th,
  .history-table td {
    font-size: 10px !important;
    padding: 7px 3px !important;
  }

  .delta-badge {
    min-width: 44px !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
  }
}

/* ===== history date grouping ===== */
.history-date-row td {
  padding: 10px 6px 6px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.history-date-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em !important;
}

.history-date-label::before {
  content: "📅";
  font-size: 11px !important;
}

.history-date-row + tr td {
  border-top: none !important;
}

@media (max-width: 420px) {
  .history-date-row td {
    padding: 8px 4px 5px !important;
  }

  .history-date-label {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }
}

/* ===== history expandable detail ===== */
.history-main-row {
  cursor: pointer !important;
}

.history-main-row:active td {
  background: #f1f5f9 !important;
}

.history-main-row td:nth-child(2)::after {
  content: "›";
  display: inline-block;
  margin-left: 5px;
  color: #94a3b8;
  font-weight: 900;
}

.history-detail-row {
  display: none !important;
}

.history-detail-row.is-open {
  display: table-row !important;
}

.history-detail-row td {
  background: #f8fafc !important;
  padding: 8px 8px 10px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.history-detail-box {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 7px !important;
  padding: 8px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

.history-detail-box div {
  min-width: 0 !important;
}

.history-detail-box span {
  display: block !important;
  margin-bottom: 3px !important;
  color: #94a3b8 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

.history-detail-box strong {
  display: block !important;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 420px) {
  .history-detail-box {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding: 7px !important;
  }

  .history-detail-box strong {
    font-size: 11px !important;
  }
}

/* ===== history detail hide final fix ===== */
.history-table tr.history-detail-row {
  display: none !important;
  visibility: hidden !important;
}

.history-table tr.history-detail-row.is-open {
  display: table-row !important;
  visibility: visible !important;
}

.history-table tr.history-detail-row:not(.is-open) td,
.history-table tr.history-detail-row:not(.is-open) .history-detail-box {
  display: none !important;
}

/* 矢印アニメーション */
.history-main-row td:nth-child(2)::after {
  transition: transform 0.2s ease !important;
}

.history-main-row.open td:nth-child(2)::after {
  transform: rotate(90deg);
}


.history-main-row td {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}


/* ===== history date label visibility fix ===== */
.history-table .history-date-row td {
  background: #eef2f7 !important;
  padding: 9px 6px 6px !important;
  overflow: visible !important;
}

.history-table .history-date-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 24px !important;
  padding: 4px 11px !important;
  border-radius: 999px !important;
  background: #334155 !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  white-space: nowrap !important;
}

.history-table .history-date-label::before {
  content: "📅" !important;
  margin-right: 5px !important;
  font-size: 12px !important;
}

@media (max-width: 420px) {
  .history-table .history-date-row td {
    padding: 8px 4px 5px !important;
  }

  .history-table .history-date-label {
    min-height: 22px !important;
    padding: 4px 9px !important;
    font-size: 11px !important;
    color: #ffffff !important;
    background: #334155 !important;
  }
}

/* ===== history date input placeholder label ===== */
.history-date-filter {
  position: relative !important;
  flex: 1 1 112px !important;
  max-width: 122px !important;
  min-width: 0 !important;
  height: 34px !important;
  display: block !important;
}

.history-date-filter span {
  position: absolute !important;
  left: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  z-index: 1 !important;
}




/* iPhone対策：値がある時はJinja側でhidden classを付与できないため、選択後はfocus時に見える */
@media (max-width: 420px) {
  .history-date-filter {
    flex-basis: 104px !important;
    max-width: 108px !important;
  }

  .history-date-filter span {
    font-size: 10px !important;
    left: 6px !important;
  }
}

/* ===== date label fix ===== */
.history-date-filter {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 110px !important;
}

.history-date-label {
  font-size: 10px !important;
  color: #94a3b8 !important;
  margin-bottom: 2px !important;
  padding-left: 4px !important;
}

.history-date-filter input {
  height: 34px !important;
  width: 100% !important;
}

/* ===== FIX: date input overlay ===== */
.history-date-filter {
  position: relative !important;
  flex: 1 1 110px !important;
  max-width: 120px !important;
  height: 34px !important;
}

/* 見た目の「日付」 */
.history-date-filter .history-date-label {
  position: absolute !important;
  left: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 12px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* 本体input（透明で上に被せる） */
.history-date-filter input[type="date"] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  z-index: 2 !important;
  cursor: pointer !important;
}

/* 値が入ったらラベル消す */
.history-date-filter input[type="date"]:valid + .history-date-label {
  display: none !important;
}


/* ===== FIX: date 2行問題 ===== */
.history-date-filter .history-date-label {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  display: block !important;
  line-height: 34px !important;
}


/* ===== history filter UI fix ===== */
.history-filter-bar {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
}

.history-filter-bar select {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

.history-date-filter {
  flex: 0 0 110px !important;
  max-width: 110px !important;
  min-width: 110px !important;
}

.history-date-filter input[type="date"] {
  font-size: 12px !important;
}

.history-filter-bar button {
  flex: 0 0 64px !important;
  white-space: nowrap !important;
}

/* スマホ最適化 */
@media (max-width: 420px) {
  .history-date-filter {
    flex: 0 0 96px !important;
    max-width: 96px !important;
  }

  .history-date-filter input[type="date"] {
    font-size: 11px !important;
  }

  .history-filter-bar button {
    flex: 0 0 58px !important;
  }
}


/* ===== history filter overlap final fix ===== */
.history-filter-bar {
  gap: 5px !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
}

.history-filter-bar select {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
}

.history-date-filter {
  flex: 0 0 92px !important;
  width: 92px !important;
  max-width: 92px !important;
  min-width: 92px !important;
  margin: 0 !important;
}

.history-date-filter .history-date-label {
  font-size: 10px !important;
  padding-left: 2px !important;
  letter-spacing: 0 !important;
}

.history-filter-bar button {
  flex: 0 0 54px !important;
  width: 54px !important;
  max-width: 54px !important;
  min-width: 54px !important;
  padding: 0 !important;
  font-size: 12px !important;
  margin-left: 0 !important;
}

@media (max-width: 420px) {
  .history-filter-bar {
    gap: 4px !important;
  }

  .history-date-filter {
    flex-basis: 88px !important;
    width: 88px !important;
    max-width: 88px !important;
    min-width: 88px !important;
  }

  .history-filter-bar button {
    flex-basis: 52px !important;
    width: 52px !important;
    max-width: 52px !important;
    min-width: 52px !important;
    font-size: 11px !important;
  }
}

/* ===== history filter 完全1行固定 ===== */
.history-filter-bar {
  display: flex !important;
  flex-wrap: nowrap !important;   /* ← 折り返し禁止 */
  align-items: center !important;
  gap: 6px !important;
}

/* セレクトは可変 */
.history-filter-bar select {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* 日付（削除してるなら無視される） */
.history-date-filter {
  flex: 0 0 90px !important;
  width: 90px !important;
}

/* ボタンは固定幅 */
.history-filter-bar button {
  flex: 0 0 60px !important;
  width: 60px !important;
  white-space: nowrap !important;
}

/* スマホ最適化 */
@media (max-width: 420px) {
  .history-filter-bar {
    gap: 4px !important;
  }

  .history-filter-bar button {
    width: 56px !important;
    flex-basis: 56px !important;
    font-size: 12px !important;
  }
}


/* ===== history filter after date removal final ===== */
.history-filter-bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  overflow: hidden !important;
}

.history-filter-bar select {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 36px !important;
  font-size: 13px !important;
}

.history-filter-bar button {
  flex: 0 0 64px !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 36px !important;
  padding: 0 !important;
  font-size: 12px !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

@media (max-width: 420px) {
  .history-filter-bar {
    gap: 6px !important;
  }

  .history-filter-bar select {
    font-size: 12px !important;
  }

  .history-filter-bar button {
    flex-basis: 58px !important;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    font-size: 11px !important;
  }
}

/* ===== person penalty page UI fix ===== */
.penalty-filter-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 150px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}

.penalty-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.penalty-filter-row select,
.penalty-filter-row input[type="date"] {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
}

.penalty-filter-action button {
  min-height: 36px;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 13px;
}

.penalty-history-table {
  table-layout: fixed;
  min-width: 720px;
}

.penalty-history-table th,
.penalty-history-table td {
  padding: 8px 7px;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.penalty-history-table th:nth-child(1),
.penalty-history-table td:nth-child(1) {
  width: 92px;
}

.penalty-history-table th:nth-child(2),
.penalty-history-table td:nth-child(2) {
  width: 110px;
}

.penalty-history-table th:nth-child(3),
.penalty-history-table td:nth-child(3) {
  width: 92px;
  text-align: center;
}

.penalty-history-table th:nth-child(5),
.penalty-history-table td:nth-child(5) {
  width: 96px;
}

.penalty-history-table th:nth-child(6),
.penalty-history-table td:nth-child(6) {
  width: 150px;
  font-size: 11px;
}

@media (max-width: 540px) {
  .penalty-filter-row {
    grid-template-columns: minmax(92px, 1fr) 128px auto;
    gap: 6px;
  }

  .penalty-filter-row label {
    font-size: 11px;
  }

  .penalty-filter-row select,
  .penalty-filter-row input[type="date"] {
    min-height: 34px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .penalty-filter-action button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* ===== person penalty final fix ===== */
.penalty-card-list {
  display: none;
}

@media (max-width: 700px) {
  .penalty-filter-row {
    display: grid !important;
    grid-template-columns: minmax(86px, 1fr) 118px 72px !important;
    gap: 6px !important;
    align-items: end !important;
  }

  .penalty-filter-row label {
    font-size: 10.5px !important;
  }

  .penalty-filter-row select,
  .penalty-filter-row input[type="date"] {
    min-height: 32px !important;
    padding: 5px 6px !important;
    font-size: 11.5px !important;
  }

  .penalty-filter-action button {
    min-height: 32px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
  }

  .penalty-table-wrap {
    display: none !important;
  }

  .penalty-card-list {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
  }

  .penalty-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
  }

  .penalty-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .penalty-card-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
  }

  .penalty-card-main {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    margin-top: 2px;
  }

  .penalty-card-count {
    min-width: 42px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
  }

  .penalty-card-grid {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 7px 10px;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
  }

  .penalty-empty {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    text-align: center;
  }
}

/* ===== payroll weekly penalty breakdown ===== */
.pay-grid small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.penalty-detail-box {
  margin-top: 10px;
}

.penalty-pay-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.penalty-pay-row {
  display: grid;
  grid-template-columns: 86px 48px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
}

.penalty-pay-row strong {
  color: #b91c1c;
  font-size: 12px;
}

.penalty-pay-row em {
  color: #334155;
  font-style: normal;
  overflow-wrap: anywhere;
}

.penalty-pay-row small {
  color: #64748b;
  font-size: 11px;
  text-align: right;
}

@media (max-width: 540px) {
  .penalty-pay-row {
    grid-template-columns: 82px 42px minmax(0, 1fr);
  }

  .penalty-pay-row small {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* ===== person penalty delete button ===== */
.inline-delete-form {
  margin: 0;
}

.danger-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.danger-mini-btn:hover {
  background: #ffe4e6;
}

.penalty-card-delete-form {
  margin: 12px 0 0;
  display: flex;
  justify-content: flex-end;
}

/* ===== assessments 4-week table ===== */
.assessment-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.assessment-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.assessment-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.assessment-table th,
.assessment-table td {
  padding: 9px 8px;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.assessment-table th {
  color: #475569;
  font-weight: 800;
}

.assessment-table th small {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

.assessment-person {
  font-weight: 900;
  color: #0f172a;
}

.assessment-person small,
.assessment-price small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.assessment-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.assessment-num.strong,
.assessment-num.result {
  font-weight: 900;
  color: #0f172a;
}

.assessment-num.penalty {
  color: #b91c1c;
  font-weight: 900;
}

.assessment-role,
.assessment-price {
  font-weight: 900;
  color: #0f172a;
}

.assessment-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.assessment-badge.on {
  background: #eff6ff;
  color: #1d4ed8;
}

.assessment-badge.off {
  background: #f8fafc;
  color: #64748b;
}

.assessment-card-list {
  display: none;
}

@media (max-width: 700px) {
  .assessment-page > .panel:first-of-type {
    display: none;
  }

  .assessment-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .assessment-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    padding: 14px;
  }

  .assessment-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
  }

  .assessment-card-name {
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
  }

  .assessment-card-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
  }

  .assessment-card-result {
    min-width: 72px;
    border-radius: 14px;
    background: #f8fafc;
    padding: 8px 10px;
    text-align: center;
  }

  .assessment-card-result span {
    display: block;
    font-size: 10px;
    color: #64748b;
    font-weight: 800;
  }

  .assessment-card-result strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    color: #0f172a;
    font-weight: 900;
  }

  .assessment-card-flags {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }

  .assessment-card-flags span {
    border-radius: 999px;
    background: #f8fafc;
    padding: 5px 9px;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
  }

  .assessment-week-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 12px;
  }

  .assessment-week-grid div {
    border-radius: 12px;
    background: #f8fafc;
    padding: 8px 6px;
    text-align: center;
  }

  .assessment-week-grid span,
  .assessment-week-grid small {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
  }

  .assessment-week-grid strong {
    display: block;
    margin: 3px 0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
  }

  .assessment-card-grid {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px 10px;
    margin-top: 12px;
    font-size: 13px;
  }

  .assessment-card-grid div {
    color: #64748b;
    font-weight: 800;
  }

  .assessment-card-grid strong {
    color: #0f172a;
    font-weight: 900;
  }

  .assessment-card-grid small {
    color: #64748b;
    font-size: 11px;
  }
}




.assessment-card-grid strong {
  font-size: 15px;
}

.assessment-card-result strong {
  font-size: 20px;
}


/* ===== assessment visibility final override ===== */
.assessment-page .assessment-table-wrap {
  display: block !important;
}

.assessment-page .assessment-card-list {
  display: none !important;
}

@media (max-width: 700px) {
  .assessment-page .assessment-table-wrap {
    display: none !important;
  }

  .assessment-page .assessment-card-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
}

/* ===== assessment table always visible ===== */
.assessment-table-wrap {
  display: block !important;
}

/* ===== assessment table force visible final ===== */
.assessment-table-force-panel {
  display: block !important;
}

.assessment-table-force-panel .assessment-table-wrap {
  display: block !important;
  overflow-x: auto !important;
}

.assessment-table-force-panel .assessment-table {
  display: table !important;
  min-width: 760px !important;
}

@media (max-width: 700px) {
  .assessment-table-force-panel {
    display: block !important;
  }

  .assessment-table-force-panel .assessment-table-wrap {
    display: block !important;
  }

  .assessment-table-force-panel .assessment-table {
    display: table !important;
  }
}

/* ===== assessment display final clean override ===== */
.assessment-table-panel {
  display: block !important;
}

.assessment-table-wrap {
  display: block !important;
  width: 100% !important;
  overflow: visible !important;
}

.assessment-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.assessment-table th,
.assessment-table td {
  padding: 7px 4px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.assessment-card-list {
  display: none !important;
}

@media (max-width: 700px) {
  .assessment-table-panel,
  .assessment-table-force-panel,
  .assessment-page > .panel:first-of-type {
    display: none !important;
  }

  .assessment-page .assessment-card-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }
}

/* ===== assessment table only final override ===== */
.assessment-table-panel,
.assessment-table-force-panel,
.assessment-page > .panel:first-of-type,
.assessment-page .assessment-table-wrap {
  display: block !important;
}

.assessment-page .assessment-table-wrap {
  width: 100% !important;
  overflow: visible !important;
}

.assessment-page .assessment-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.assessment-page .assessment-table th,
.assessment-page .assessment-table td {
  padding: 5px 2px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.assessment-page .assessment-person small,
.assessment-page .assessment-price small {
  font-size: 8px !important;
}

.assessment-page .assessment-card-list {
  display: none !important;
}

@media (max-width: 700px) {
  .assessment-table-panel,
  .assessment-table-force-panel,
  .assessment-page > .panel:first-of-type,
  .assessment-page .assessment-table-wrap {
    display: block !important;
  }

  .assessment-page .assessment-card-list {
    display: none !important;
  }
}

/* ===== assessment show table and cards ===== */
.assessment-page .assessment-table-wrap,
.assessment-page .assessment-card-list {
  display: block !important;
}

.assessment-page .assessment-card-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.assessment-page .assessment-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

@media (max-width: 700px) {
  .assessment-page .assessment-table-wrap,
  .assessment-page .assessment-card-list {
    display: block !important;
  }

  .assessment-page .assessment-card-list {
    display: flex !important;
  }
}

/* ===== assessment table overlap fix ===== */
.assessment-page .assessment-table-wrap {
  display: block !important;
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

.assessment-page .assessment-table {
  display: table !important;
  width: max-content !important;
  min-width: 980px !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

.assessment-page .assessment-table th,
.assessment-page .assessment-table td {
  padding: 8px 10px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  vertical-align: middle !important;
}

.assessment-page .assessment-table th {
  font-size: 11px !important;
  text-align: center !important;
}

.assessment-page .assessment-table td.assessment-person {
  min-width: 130px !important;
  white-space: normal !important;
}

.assessment-page .assessment-table td.assessment-role,
.assessment-page .assessment-table td.assessment-price {
  min-width: 70px !important;
}

.assessment-page .assessment-table .assessment-num {
  min-width: 48px !important;
  text-align: right !important;
}

.assessment-page .assessment-person small,
.assessment-page .assessment-price small {
  display: block !important;
  font-size: 10px !important;
  white-space: normal !important;
}

/* ===== assessment compact table final ===== */
.assessment-page .assessment-compact-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.assessment-page .assessment-compact-table th,
.assessment-page .assessment-compact-table td {
  padding: 8px 5px !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  vertical-align: middle !important;
}

.assessment-page .assessment-compact-table th:nth-child(1),
.assessment-page .assessment-compact-table td:nth-child(1) {
  width: 18%;
}

.assessment-page .assessment-compact-table th:nth-child(2),
.assessment-page .assessment-compact-table td:nth-child(2) {
  width: 13%;
}

.assessment-page .assessment-compact-table th:nth-child(3),
.assessment-page .assessment-compact-table td:nth-child(3) {
  width: 24%;
}

.assessment-page .assessment-compact-table th:nth-child(4),
.assessment-page .assessment-compact-table td:nth-child(4),
.assessment-page .assessment-compact-table th:nth-child(5),
.assessment-page .assessment-compact-table td:nth-child(5),
.assessment-page .assessment-compact-table th:nth-child(6),
.assessment-page .assessment-compact-table td:nth-child(6) {
  width: 8%;
  text-align: center !important;
}

.assessment-page .assessment-compact-table th:nth-child(7),
.assessment-page .assessment-compact-table td:nth-child(7) {
  width: 21%;
}

.assessment-flags-cell,
.assessment-weeks-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.assessment-weeks-cell span {
  white-space: nowrap;
}

.assessment-person small,
.assessment-price small {
  display: block;
  margin-top: 2px;
  font-size: 9px !important;
  color: #64748b;
}

@media (max-width: 700px) {
  .assessment-page .assessment-table-wrap {
    overflow: visible !important;
  }

  .assessment-page .assessment-compact-table th,
  .assessment-page .assessment-compact-table td {
    padding: 6px 3px !important;
    font-size: 9.5px !important;
  }

  .assessment-page .assessment-compact-table th:nth-child(1),
  .assessment-page .assessment-compact-table td:nth-child(1) {
    width: 18%;
  }

  .assessment-page .assessment-compact-table th:nth-child(3),
  .assessment-page .assessment-compact-table td:nth-child(3) {
    width: 25%;
  }

  .assessment-person small,
  .assessment-price small {
    font-size: 8px !important;
  }
}

/* ===== clean assessment table layout ===== */
.assessment-page-clean {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.assessment-result-table {
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
}

.assessment-result-head,
.assessment-result-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr .6fr .55fr .65fr 1fr;
  align-items: center;
  gap: 8px;
}

.assessment-result-head {
  padding: 10px 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.assessment-result-row {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
}

.ar-person strong,
.ar-role strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.ar-person span,
.ar-role span,
.ar-flags span,
.ar-weeks span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.ar-weeks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

.ar-weeks b {
  color: #0f172a;
}

.ar-num {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.ar-num.penalty {
  color: #b91c1c;
}

.ar-num.result {
  font-size: 16px;
}

.assessment-result-empty {
  padding: 16px;
  color: #64748b;
  font-weight: 800;
}

@media (max-width: 700px) {
  .assessment-result-head {
    display: none;
  }

  .assessment-result-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    padding: 14px;
  }

  .ar-person {
    grid-column: 1 / 2;
  }

  .ar-role {
    grid-column: 2 / 3;
    text-align: right;
  }

  .ar-flags,
  .ar-weeks {
    grid-column: 1 / -1;
  }

  .ar-weeks {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .ar-weeks span {
    background: #f8fafc;
    border-radius: 10px;
    padding: 7px 4px;
    text-align: center;
    font-size: 10px;
  }

  .ar-num {
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 4px;
    font-size: 14px;
  }

  .ar-num::before {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    margin-bottom: 2px;
  }

  .ar-num:nth-of-type(4)::before { content: "平均"; }
  .ar-num:nth-of-type(5)::before { content: "ペナ"; }
  .ar-num:nth-of-type(6)::before { content: "結果"; }
}

/* ===== assessment card only final ===== */
.assessment-result-table {
  display: none !important;
}

.assessment-card-only,
.assessment-page-clean .assessment-card-list,
.assessment-page .assessment-card-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
}

.assessment-card-only .assessment-card {
  display: block !important;
}

/* ===== notification page clean final ===== */

/* filter */
.notification-page .mypage-section:first-of-type {
  margin-bottom: 10px !important;
}

.notification-filter-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 126px !important;
  gap: 6px !important;
  align-items: center !important;
  width: 100% !important;
  margin: 0 !important;
}

.notification-filter-bar select,
.notification-filter-bar input {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid #d7dee2 !important;
  background: #fff !important;
  padding: 0 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  box-sizing: border-box !important;
}

.notification-filter-bar button {
  display: none !important;
}

/* grid table */
.notification-grid-table {
  width: 100% !important;
  max-width: 100% !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

.notification-grid-head,
.notification-grid-row {
  display: grid !important;
  grid-template-columns: 74px 0.72fr 0.72fr 104px 34px 38px !important;
  gap: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.notification-grid-head div {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  padding: 5px 3px !important;
  border-right: 1px solid #e5e7eb !important;
  border-bottom: 1px solid #e5e7eb !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

.notification-grid-head div:last-child {
  border-right: 0 !important;
}

.notification-grid-row {
  border-bottom: 1px solid #e5e7eb !important;
}

.notification-grid-row:last-child {
  border-bottom: 0 !important;
}

.notification-grid-cell {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #fff !important;
  border-right: 1px solid #e5e7eb !important;
  border-radius: 0 !important;
  padding: 5px 3px !important;
  color: #111827 !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.notification-grid-cell:last-child {
  border-right: 0 !important;
}

.notification-grid-cell.type {
  background: #fff !important;
  color: #111827 !important;
  text-align: center !important;
  font-size: 9px !important;
  font-weight: 800 !important;
}

.notification-grid-cell.date {
  font-size: 8.8px !important;
  letter-spacing: -0.6px !important;
}

.notification-grid-cell.line {
  text-align: center !important;
  font-size: 8.8px !important;
}

.notification-grid-cell.line.off {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.notification-grid-cell.line.on {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.notification-grid-cell.detail {
  text-align: center !important;
  overflow: visible !important;
}

.notification-grid-cell.detail summary {
  cursor: pointer !important;
  list-style: none !important;
  font-size: 8.8px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.notification-grid-cell.detail summary::-webkit-details-marker {
  display: none !important;
}

.notification-grid-cell.detail details[open] {
  position: relative !important;
  z-index: 5 !important;
}

.notification-grid-cell.detail div {
  position: absolute !important;
  right: 6px !important;
  left: 6px !important;
  margin-top: 8px !important;
  padding: 10px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
  color: #374151 !important;
  text-align: left !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
}

/* empty */
.notification-empty {
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  background: #fff !important;
  padding: 16px !important;
  color: #6b7280 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-align: center !important;
}

/* wider screens */
@media (min-width: 701px) {
  .notification-grid-head,
  .notification-grid-row {
    grid-template-columns: 100px 1fr 1fr 132px 48px 52px !important;
  }

  .notification-grid-cell {
    font-size: 11px !important;
    padding: 7px 6px !important;
  }

  .notification-grid-cell.type {
    font-size: 10px !important;
  }

  .notification-grid-cell.date {
    font-size: 10px !important;
  }

  .notification-grid-head div {
    font-size: 10px !important;
    padding: 7px 6px !important;
  }
}


/* ===== notification detail full width fix ===== */
.notification-grid-cell.detail {
  overflow: hidden !important;
}

.notification-detail-toggle {
  width: 100% !important;
  height: 100% !important;
  min-height: 20px !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 8.8px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  padding: 0 !important;
}

.notification-detail-panel {
  display: none !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-left: 1px solid #e5e7eb !important;
  border-right: 1px solid #e5e7eb !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #fff !important;
  padding: 10px !important;
  color: #374151 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

.notification-detail-panel.is-open {
  display: block !important;
}

@media (min-width: 701px) {
  .notification-detail-toggle {
    font-size: 10px !important;
  }
}

/* ===== notification vertical center fix ===== */

.notification-grid-head,
.notification-grid-row {
  align-items: center !important;
}

.notification-grid-cell {
  display: flex !important;
  align-items: center !important;
}

/* テキストも中央寄せ */
.notification-grid-cell.type,
.notification-grid-cell.line,
.notification-grid-cell.date {
  justify-content: center !important;
}

/* 長文系は左寄せ維持 */
.notification-grid-cell:nth-child(2),
.notification-grid-cell:nth-child(3) {
  justify-content: flex-start !important;
}

/* ===== notification real vertical center fix ===== */
.notification-grid-head div,
.notification-grid-cell {
  display: flex !important;
  align-items: center !important;
  min-height: 28px !important;
  box-sizing: border-box !important;
}

.notification-grid-head div {
  justify-content: center !important;
}

.notification-grid-cell.type,
.notification-grid-cell.date,
.notification-grid-cell.line,
.notification-grid-cell.detail {
  justify-content: center !important;
}

.notification-grid-cell:nth-child(2),
.notification-grid-cell:nth-child(3) {
  justify-content: flex-start !important;
}

.notification-detail-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ===== notification mobile width restore ===== */
.notification-grid-head,
.notification-grid-row {
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 76px 24px 34px !important;
}

.notification-grid-head div,
.notification-grid-cell {
  padding-left: 2px !important;
  padding-right: 2px !important;
  font-size: 8.8px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.notification-grid-cell.date {
  font-size: 8px !important;
  letter-spacing: -0.8px !important;
}

.notification-grid-cell.line {
  font-size: 8px !important;
}

.notification-detail-toggle {
  font-size: 8px !important;
}

.notification-grid-cell.type {
  background: #fff !important;
  color: #111827 !important;
  font-weight: 800 !important;
}

@media (min-width: 701px) {
  .notification-grid-head,
  .notification-grid-row {
    grid-template-columns: 82px 1fr 1fr 1fr 120px 42px 48px !important;
  }

  .notification-grid-head div,
  .notification-grid-cell {
    font-size: 10px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .notification-grid-cell.date {
    font-size: 10px !important;
  }
}

/* ===== notification compact text final ===== */
.notification-grid-cell {
  font-size: 8.2px !important;
}

.notification-grid-cell.type,
.notification-grid-cell.date,
.notification-grid-cell.line,
.notification-detail-toggle {
  font-size: 7.8px !important;
}

.notification-grid-head div {
  font-size: 7.8px !important;
}

@media (min-width: 701px) {
  .notification-grid-cell {
    font-size: 10px !important;
  }

  .notification-grid-cell.type,
  .notification-grid-cell.date,
  .notification-grid-cell.line,
  .notification-detail-toggle {
    font-size: 9.5px !important;
  }

  .notification-grid-head div {
    font-size: 9.5px !important;
  }
}

/* ===== header full label fit ===== */
.notification-grid-head div {
  font-size: 7px !important;
  letter-spacing: -0.4px !important;
  white-space: nowrap !important;
}

/* 依頼者/操作者だけさらに圧縮 */
.notification-grid-head div:nth-child(2) {
  font-size: 6.6px !important;
  letter-spacing: -0.6px !important;
}

/* セルも少し圧縮 */
.notification-grid-cell {
  font-size: 8px !important;
}

/* PCは通常サイズ */
@media (min-width: 701px) {
  .notification-grid-head div {
    font-size: 10px !important;
    letter-spacing: normal !important;
  }

  .notification-grid-head div:nth-child(2) {
    font-size: 10px !important;
  }

  .notification-grid-cell {
    font-size: 10px !important;
  }
}

/* ===== LINE targets page ===== */
.line-target-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.line-target-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  font-size: 12px;
}

.line-target-table th,
.line-target-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}

.line-target-table th {
  background: #f3f4f6;
  font-weight: 900;
  white-space: nowrap;
}

.line-target-table .mono {
  font-family: monospace;
  font-size: 11px;
}

@media (max-width: 700px) {
  .line-target-table {
    font-size: 10px;
    min-width: 760px;
  }

  .line-target-table th,
  .line-target-table td {
    padding: 6px;
  }
}

/* ===== LINE ID page design ===== */
.line-targets-page {
  max-width: 980px;
}

.line-hero-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin: 16px 0 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 1px solid #dcefe3;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.line-hero-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.line-hero-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 900;
  color: #111827;
}

.line-hero-card p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
}

.line-hero-count {
  min-width: 96px;
  height: 96px;
  border-radius: 20px;
  background: #111827;
  color: #fff;
  display: grid;
  place-content: center;
  text-align: center;
}

.line-count-num {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.line-count-label {
  margin-top: 6px;
  font-size: 12px;
  color: #d1d5db;
  font-weight: 700;
}

.line-target-list {
  display: grid;
  gap: 14px;
}

.line-target-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.line-target-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.line-target-top h2 {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 900;
  color: #111827;
}

.line-type-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
}

.line-type-badge.user {
  background: #dcfce7;
  color: #166534;
}

.line-type-badge.group {
  background: #e0f2fe;
  color: #075985;
}

.line-type-badge.room {
  background: #fef3c7;
  color: #92400e;
}

.line-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.line-status.on {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.line-status.off {
  background: #f9fafb;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.line-id-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #edf0f3;
  margin-bottom: 12px;
}

.line-id-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.line-id-box code {
  word-break: break-all;
  font-size: 13px;
  color: #111827;
  background: transparent;
}

.line-copy-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.line-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.line-meta-grid div {
  padding: 10px;
  border-radius: 12px;
  background: #fbfbfc;
  border: 1px solid #f0f1f3;
}

.line-meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.line-meta-grid strong {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  word-break: break-word;
}

.line-empty-card {
  padding: 28px 18px;
  text-align: center;
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: 18px;
}

.line-empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: #dcfce7;
  color: #166534;
  display: grid;
  place-content: center;
  font-size: 13px;
  font-weight: 900;
}

.line-empty-title {
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

.line-empty-card p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 14px;
}

@media (max-width: 700px) {
  .line-hero-card {
    flex-direction: column;
    padding: 18px;
  }

  .line-hero-count {
    width: 100%;
    height: 74px;
  }

  .line-id-box {
    grid-template-columns: 1fr;
  }

  .line-copy-btn {
    width: 100%;
  }

  .line-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== LINE ID smart design ===== */
.line-targets-page.smart {
  max-width: 920px;
}

.line-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 18px 4px 14px;
}

.line-page-kicker {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #16a34a;
  text-transform: uppercase;
}

.line-page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
}

.line-page-head p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.line-page-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.line-smart-list {
  display: grid;
  gap: 10px;
}

.line-smart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.line-smart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.line-smart-title strong {
  font-size: 14px;
  font-weight: 900;
  color: #111827;
}

.line-smart-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 900;
}

.line-smart-badge.user {
  background: #dcfce7;
  color: #166534;
}

.line-smart-badge.group {
  background: #e0f2fe;
  color: #075985;
}

.line-smart-badge.room {
  background: #fef3c7;
  color: #92400e;
}

.line-smart-id {
  padding: 9px 10px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #eef0f2;
  color: #111827;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.line-smart-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
}

.line-smart-meta span {
  padding-right: 8px;
  border-right: 1px solid #e5e7eb;
}

.line-smart-meta span:last-child {
  border-right: 0;
}

.line-smart-copy {
  border: 0;
  border-radius: 12px;
  padding: 10px 13px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.line-smart-empty {
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  font-size: 14px;
}

@media (max-width: 700px) {
  .line-page-head {
    align-items: flex-start;
  }

  .line-smart-row {
    grid-template-columns: 1fr;
  }

  .line-smart-copy {
    width: 100%;
  }
}

/* ===== Settings page layout ===== */
.settings-page {
  max-width: 860px;
}

.settings-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.settings-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f1f3;
  margin-bottom: 16px;
}

.settings-card-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #111827;
}

.settings-card-head p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #edf0f2;
  border-radius: 14px;
  background: #f9fafb;
  cursor: pointer;
}

.settings-check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.settings-check-row span {
  display: grid;
  gap: 4px;
}

.settings-check-row strong {
  font-size: 14px;
  font-weight: 900;
  color: #111827;
}

.settings-check-row small {
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.settings-field {
  display: grid;
  gap: 7px;
}

.settings-field label {
  font-size: 13px;
  font-weight: 900;
  color: #111827;
}

.settings-field input {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  border: 1px solid #d7dee2;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.settings-field p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.settings-actions button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.settings-muted-card {
  background: #fafafa;
  box-shadow: none;
}

@media (max-width: 700px) {
  .settings-card {
    padding: 15px;
    border-radius: 16px;
  }

  .settings-actions button {
    width: 100%;
  }
}
