:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --line: #d9e6f5;
  --line-strong: #c5d8ee;
  --text: #172033;
  --muted: #65758b;
  --blue: #1264d8;
  --blue-dark: #0b4eb0;
  --blue-soft: #e8f2ff;
  --green: #18865b;
  --amber: #b97812;
  --red: #d44343;
  --shadow: 0 18px 50px rgba(24, 64, 120, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

/* Ver2.0 visual refresh */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  font-family: Inter, "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  color: var(--text);
  background: radial-gradient(circle at top left, #eef6ff 0, transparent 360px), var(--bg);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-screen.hidden {
  display: none;
}

.app-shell.locked {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

.login-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  justify-self: center;
}

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

.login-heading h1 {
  margin: 0;
  font-size: 26px;
}

.login-heading p,
.login-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-button {
  min-height: 46px;
  border-radius: 12px;
}

.app-shell {
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(226, 232, 240, 0.9);
}

.brand {
  gap: 14px;
  margin-bottom: 30px;
  padding: 8px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.brand-mark {
  display: none;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  gap: 8px;
}

.nav-separator {
  height: 1px;
  margin: 10px 8px;
  background: var(--line);
}

.nav-link {
  min-height: 46px;
  padding: 0 14px;
  gap: 12px;
  border-radius: 14px;
  color: #334155;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  color: var(--blue-dark);
  background: #f1f5f9;
  transform: translateX(2px);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.nav-link.disabled {
  color: #94a3b8;
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
}

.nav-icon svg,
.search-icon svg,
.icon-button svg,
.card-icon svg {
  width: 100%;
  height: 100%;
}

.main {
  padding: 34px 44px 56px;
}

.topbar {
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin-top: 4px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 12px;
}

.global-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 340px;
  min-height: 42px;
  padding: 0 10px 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.search-icon {
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.global-search {
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.global-search:focus {
  box-shadow: none;
}

.search-submit {
  min-height: 30px;
  padding: 0 10px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.icon-button,
.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.icon-button {
  width: 42px;
  color: var(--muted);
}

.user-chip {
  gap: 8px;
  padding: 0 12px 0 6px;
  color: #334155;
  font-weight: 750;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.text-button {
  border-radius: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
}

.content {
  animation: fadeIn 180ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.card,
.mini-card,
.folder-card,
.order-card,
.customer-card,
.file-card,
.todo-card {
  border-color: rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.card,
.mini-card {
  position: relative;
  min-height: 124px;
  padding: 22px;
}

.stat-card {
  overflow: hidden;
}

.card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 12px;
  margin-bottom: 14px;
}

.card-label {
  color: var(--muted);
}

.card-value {
  font-size: 32px;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.todo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  background: #fff;
}

.todo-card span {
  color: var(--muted);
  font-weight: 750;
}

.todo-card strong {
  font-size: 24px;
}

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

.customer-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.customer-card:hover,
.folder-card:hover,
.order-card:hover,
.file-card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.12);
}

.customer-card-top,
.customer-owner,
.customer-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-card h3 {
  margin: 0;
  font-size: 19px;
}

.customer-card p,
.customer-owner {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.customer-metrics span {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
}

.customer-metrics strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.folder-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.folder-profile img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 16px;
}

.folder-status-grid {
  background: #fbfdff;
}

.timeline {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: flex;
  gap: 10px;
  min-width: 210px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: var(--blue);
  border-radius: 999px;
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item p,
.timeline-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  padding: 18px 20px;
}

.tab {
  min-height: 38px;
  border-radius: 12px;
}

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

.file-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.file-thumb {
  display: grid;
  height: 96px;
  place-items: center;
  color: var(--blue);
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  font-weight: 900;
}

.file-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.file-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status.法人,
.status.本院,
.status.継続中,
.status.継続,
.status.保守中,
.status.広告運用中 {
  color: #15803d;
  background: #dcfce7;
}

.status.解約,
.status.未対応,
.status.終了 {
  color: #b91c1c;
  background: #fee2e2;
}

.status.対応中 {
  color: #92400e;
  background: #fef3c7;
}

.status.保留 {
  color: #475569;
  background: #f1f5f9;
}

.status.納品済,
.status.完了 {
  color: #1d4ed8;
  background: #dbeafe;
}

.status.制作中,
.status.修正中 {
  color: #7e22ce;
  background: #f3e8ff;
}

@media (max-width: 1280px) {
  .customer-grid,
  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .global-search-wrap {
    width: 100%;
  }

  .quick-menu,
  .user-chip span:not(.avatar) {
    display: none;
  }

  .customer-grid,
  .file-grid,
  .todo-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 260px), var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(18, 100, 216, 0.22);
}

.brand-title,
.brand-version,
.eyebrow {
  margin: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 760;
}

.brand-version,
.eyebrow,
.panel-subtitle,
.card-note {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  color: #33435a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
}

.nav-link.active {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.nav-link.disabled {
  color: #8c98a8;
  cursor: not-allowed;
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--blue);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.main {
  min-width: 0;
  padding: 30px 36px 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

h1 {
  margin: 5px 0 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.topbar-actions,
.form-actions,
.row-actions,
.detail-actions,
.list-tools,
.folder-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.danger-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.ghost-button {
  color: #23517d;
  background: #fff;
  border-color: var(--line-strong);
}

.danger-button {
  color: #fff;
  background: var(--red);
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  color: var(--blue);
  background: transparent;
}

.danger-text {
  color: var(--red);
}

.content {
  display: grid;
  gap: 20px;
}

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

.stats-grid.wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card,
.panel,
.mini-card,
.folder-card,
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card,
.mini-card {
  padding: 20px;
}

.card-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card-value {
  margin: 0;
  font-size: 30px;
  font-weight: 820;
}

.metric-line {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.card-note,
.panel-subtitle {
  margin: 8px 0 0;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 18px;
}

.search-box {
  width: min(420px, 100%);
  min-height: 42px;
  padding: 0 14px;
  background: #fbfdff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.global-search {
  width: min(360px, 32vw);
  min-height: 40px;
  padding: 0 14px;
  background: #fbfdff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: none;
}

.global-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 100, 216, 0.11);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #56677f;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 800;
}

tr:hover td {
  background: #fbfdff;
}

.id-badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.id-badge {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.status {
  color: #20425d;
  background: #eef3f8;
}

.status.法人,
.status.本院,
.status.継続中,
.status.納品済,
.status.保守中 {
  color: #08704b;
  background: #e6f7ef;
}

.status.分院,
.status.進行中 {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.status.完了 {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.status.対応中 {
  color: #8a5a00;
  background: #fff4cc;
}

.status.屋号,
.status.単院,
.status.未着手 {
  color: var(--amber);
  background: #fff5dd;
}

.status.解約,
.status.停止,
.status.未対応 {
  color: var(--red);
  background: #ffeded;
}

.status.保留 {
  color: #596579;
  background: #eef1f5;
}

.status.制作中 {
  color: #6f42c1;
  background: #f0e7ff;
}

.table-link {
  color: var(--blue-dark);
  font-weight: 800;
}

.empty,
.empty-state {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 18px;
}

.form-panel {
  padding: 22px;
}

.form-section-title {
  margin-bottom: 18px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
}

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

label {
  display: grid;
  gap: 8px;
  color: #415168;
  font-size: 13px;
  font-weight: 800;
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

select[multiple] {
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 100, 216, 0.11);
}

.form-actions {
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.detail-item {
  padding: 18px 20px;
  background: #fff;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-value {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.payment-grid,
.folder-grid,
.order-card-grid,
.folder-status-grid {
  display: grid;
  gap: 16px;
  padding: 20px;
}

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

.folder-status-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

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

.folder-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  box-shadow: none;
}

.folder-card h3,
.order-card h3 {
  margin: 0;
  font-size: 17px;
}

.folder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.folder-meta span {
  padding: 5px 8px;
  color: #23517d;
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: #40516a;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tab.active {
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: #b7d5fb;
}

.tab-body {
  padding: 20px;
}

.tab-body > .table-wrap {
  margin: -20px;
}

.folder-action {
  justify-content: flex-end;
  margin-bottom: 14px;
}

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

.order-card {
  padding: 18px;
  box-shadow: none;
}

.order-card-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.order-card dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 14px 0;
}

.order-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 13px 16px;
  color: #fff;
  background: #12395e;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(18, 57, 94, 0.24);
  font-weight: 750;
  opacity: 0;
  transform: translateY(20px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .main {
    padding: 22px 18px 34px;
  }

  .topbar,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .payment-grid,
  .folder-grid,
  .order-card-grid,
  .folder-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .nav,
  .stats-grid,
  .stats-grid.wide,
  .payment-grid,
  .folder-grid,
  .order-card-grid,
  .folder-status-grid,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-item.full,
  .full {
    grid-column: auto;
  }

  .topbar-actions,
  .form-actions,
  .detail-actions,
  .list-tools {
    width: 100%;
  }

  .topbar-actions > *,
  .form-actions > *,
  .detail-actions > *,
  .list-tools > * {
    flex: 1;
  }
}

/* Ver2.0 final overrides */
body {
  color: #0f172a;
  background: radial-gradient(circle at top left, #eef6ff 0, transparent 360px), #f8fafc;
  font-family: Inter, "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-screen.hidden {
  display: none;
}

.app-shell.locked {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

.login-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  justify-self: center;
}

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

.login-heading h1 {
  margin: 0;
  font-size: 26px;
}

.login-heading p,
.login-note {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #ef4444;
  font-size: 13px;
  font-weight: 750;
}

.password-field {
   position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
    width: 100%;
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;

  border: none;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  background: #eff6ff;
}

.remember-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}

.remember-row input {
  width: 16px;
  min-height: 16px;
  accent-color: #2563eb;
}

.login-button {
  min-height: 46px;
  border-radius: 12px;
}

.app-shell {
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(226, 232, 240, 0.9);
}

.brand {
  gap: 14px;
  margin-bottom: 30px;
  padding: 8px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.brand-mark {
  display: none;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
}

.nav-separator {
  height: 1px;
  margin: 10px 8px;
  background: #e2e8f0;
}

.nav-link {
  min-height: 46px;
  padding: 0 14px;
  gap: 12px;
  border-radius: 14px;
  color: #334155;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  color: #1d4ed8;
  background: #f1f5f9;
  transform: translateX(2px);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
}

.nav-icon svg,
.search-icon svg,
.icon-button svg,
.card-icon svg {
  width: 100%;
  height: 100%;
}

.main {
  padding: 34px 44px 56px;
}

.topbar {
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin-top: 4px;
  font-size: 30px;
}

.global-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 340px;
  min-height: 42px;
  padding: 0 10px 0 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.search-icon {
  display: grid;
  width: 18px;
  height: 18px;
  color: #64748b;
}

.global-search {
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.global-search:focus {
  box-shadow: none;
}

.search-submit {
  min-height: 30px;
  padding: 0 10px;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.icon-button,
.user-chip,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.icon-button {
  width: 42px;
  color: #64748b;
}

.user-chip {
  gap: 8px;
  padding: 0 12px 0 6px;
  color: #334155;
  font-weight: 750;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: #2563eb;
  border-radius: 999px;
  font-size: 12px;
}

.secondary-button {
  padding: 0 15px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
}

.primary-button {
  background: #2563eb;
}

.primary-button:hover {
  background: #1d4ed8;
}

.content {
  animation: fadeIn 180ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.card,
.mini-card,
.folder-card,
.order-card,
.customer-card,
.file-card,
.todo-card {
  border-color: rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card,
.mini-card {
  min-height: 124px;
  padding: 22px;
}

.card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 12px;
  margin-bottom: 14px;
}

.todo-grid,
.customer-grid,
.file-grid {
  display: grid;
  gap: 18px;
  padding: 20px;
}

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

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

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

.todo-card,
.customer-card,
.file-card {
  background: #fff;
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.customer-card:hover,
.folder-card:hover,
.order-card:hover,
.file-card:hover,
.todo-card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.12);
}

.customer-card {
  display: grid;
  gap: 14px;
}

.customer-card-top,
.customer-owner,
.customer-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-card h3 {
  margin: 0;
  font-size: 19px;
}

.customer-title-link {
  color: #0f172a;
  text-decoration: none;
}

.customer-title-link:hover {
  color: #2563eb;
}

.customer-card p,
.customer-owner {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.customer-metrics span {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 14px;
  color: #64748b;
  font-size: 12px;
}

.customer-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.delete-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(10px);
}

.delete-modal {
  width: min(440px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.delete-modal-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 16px;
  color: #ef4444;
  background: #fef2f2;
  border-radius: 14px;
  font-weight: 800;
}

.delete-modal h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
}

.delete-modal-target {
  margin: 10px 0 18px;
  color: #2563eb;
  font-weight: 700;
}

.delete-modal-note {
  margin: 0 0 10px;
  color: #64748b;
}

.delete-modal ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 20px;
  color: #475569;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.customer-metrics strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
}

.folder-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.folder-profile img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 16px;
}

.timeline {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 18px 20px;
  border-top: 1px solid #e2e8f0;
}

.timeline-item {
  display: flex;
  gap: 10px;
  min-width: 210px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: #2563eb;
  border-radius: 999px;
}

.timeline-item p,
.timeline-empty {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.file-thumb {
  display: grid;
  height: 96px;
  place-items: center;
  color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  font-weight: 900;
}

.file-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.file-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status.法人,
.status.本院,
.status.継続中,
.status.継続,
.status.保守中,
.status.広告運用中 {
  color: #15803d;
  background: #dcfce7;
}

.status.解約,
.status.未対応,
.status.終了 {
  color: #b91c1c;
  background: #fee2e2;
}

.status.対応中 {
  color: #92400e;
  background: #fef3c7;
}

.status.保留 {
  color: #475569;
  background: #f1f5f9;
}

.status.納品済,
.status.完了 {
  color: #1d4ed8;
  background: #dbeafe;
}

.status.制作中,
.status.修正中 {
  color: #7e22ce;
  background: #f3e8ff;
}

@media (max-width: 1280px) {
  .customer-grid,
  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .global-search-wrap {
    width: 100%;
  }

  .quick-menu,
  .user-chip span:not(.avatar) {
    display: none;
  }

  .customer-grid,
  .file-grid,
  .todo-grid {
    grid-template-columns: 1fr;
  }
}
