﻿:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --ink: #1d252b;
  --muted: #62707b;
  --line: #d9e0e5;
  --primary: #176b67;
  --primary-dark: #0f504d;
  --accent: #a43f26;
  --warning: #b07d12;
  --success: #277044;
  --danger: #b43333;
  --shadow: 0 18px 36px rgba(29, 37, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

a.link-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
}

.small-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: #13282c;
}

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

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.24);
}

.login-card .brand {
  color: var(--ink);
  margin-bottom: 6px;
}

.login-contact {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.app-shell.locked {
  display: none;
}

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

.sidebar {
  background: #13282c;
  color: #eef7f6;
  padding: 18px 12px;
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #f0b84f;
  color: #13282c;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #a8c1c1;
  margin-top: 2px;
}

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

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d9e8e8;
  padding: 10px 12px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 17px;
}

.topbar-actions,
.toolbar,
.modal-actions,
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.api-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.api-status.connected {
  border-color: #b7d9c6;
  background: #e6f4eb;
  color: var(--success);
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.primary,
.ghost,
.icon-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 9px 14px;
}

.primary {
  background: var(--primary);
  color: white;
}

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

.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  font-size: 24px;
  line-height: 1;
}

.view {
  display: none;
}

.toast {
  display: none;
  margin-bottom: 14px;
  border: 1px solid #efc6c6;
  border-radius: 8px;
  background: #fff0f0;
  color: var(--danger);
  padding: 10px 12px;
  font-weight: 700;
}

.toast.show {
  display: block;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 18px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.split-resizable {
  align-items: stretch;
  gap: 0;
}

.split-resize-handle {
  position: relative;
  align-self: stretch;
  min-height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 8;
}

.split-resize-handle::before {
  content: "";
  position: absolute;
  inset: 8px 5px;
  border-radius: 999px;
  background: rgba(22, 119, 112, 0.22);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.split-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 44px;
  border-left: 2px solid rgba(22, 119, 112, 0.72);
  border-right: 2px solid rgba(22, 119, 112, 0.72);
  transform: translate(-50%, -50%);
}

.split-resize-handle:hover::before,
.resizing-split .split-resize-handle::before {
  background: rgba(22, 119, 112, 0.34);
  box-shadow: 0 0 0 3px rgba(22, 119, 112, 0.12);
}

.split-resizable-vertical {
  align-items: stretch;
}

.split-resize-handle.vertical {
  min-height: 14px;
  height: 14px;
  width: 100%;
  cursor: row-resize;
}

.split-resize-handle.vertical::before {
  inset: 5px 8px;
}

.split-resize-handle.vertical::after {
  top: 50%;
  left: 50%;
  width: 44px;
  height: 4px;
  border-left: 0;
  border-right: 0;
  border-top: 2px solid rgba(22, 119, 112, 0.72);
  border-bottom: 2px solid rgba(22, 119, 112, 0.72);
}

.split-resize-handle.vertical:hover::before,
.resizing-split-vertical .split-resize-handle.vertical::before {
  background: rgba(22, 119, 112, 0.34);
  box-shadow: 0 0 0 3px rgba(22, 119, 112, 0.12);
}

.panel {
  min-width: 0;
  min-height: 180px;
  max-width: 100%;
  padding: 18px;
  overflow: auto;
  scrollbar-gutter: stable;
  position: relative;
}

.panel.full {
  width: 100%;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.notification-item.unread {
  border-color: #7db9b4;
  background: #f1fbfa;
}

.notification-item.unread .item-title::before {
  content: "미읽음";
  display: inline-flex;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
  vertical-align: middle;
}

.notification-item.read {
  opacity: 0.72;
}

.panel > .item,
.panel > .list > .item,
.lane .item {
  min-height: 76px;
  overflow: auto;
}

.item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  font-weight: 800;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.compact .item {
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.pending,
.badge.pending_reflect {
  background: #fff3d6;
  color: #78530a;
}

.badge.approved,
.badge.done {
  background: #ddf1e5;
  color: var(--success);
}

.badge.rejected,
.badge.failed {
  background: #f8dddd;
  color: var(--danger);
}

.badge.urgent {
  background: #fde2d7;
  color: var(--accent);
}

.flow-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.flow-map div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
}

.flow-map b,
.flow-map span {
  display: block;
}

.flow-map span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar input {
  max-width: 360px;
}

.toolbar select,
.toolbar input[type="date"],
.toolbar input[type="number"],
.toolbar input[type="search"] {
  flex: 1 1 160px;
}

.attachment-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--surface-2);
}

.pdf-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.segmented {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 9px 13px;
  white-space: nowrap;
}

.segmented button:last-child {
  border-right: 0;
}

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

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

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

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

th {
  background: #f0f4f5;
  color: #41515b;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.row-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 9px;
}

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

.lane {
  min-width: 220px;
  min-height: 520px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f4;
  padding: 12px;
  overflow: auto;
  scrollbar-gutter: stable;
  position: relative;
}


.resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-right: 3px solid rgba(98, 112, 123, 0.55);
  border-bottom: 3px solid rgba(98, 112, 123, 0.55);
  cursor: nwse-resize;
  z-index: 5;
  touch-action: none;
}

.resize-handle:hover {
  border-color: var(--primary);
}

.resize-handle.height-only {
  width: 34px;
  height: 14px;
  right: 50%;
  bottom: 5px;
  border-right: 0;
  border-bottom: 3px solid rgba(98, 112, 123, 0.55);
  transform: translateX(50%);
  cursor: ns-resize;
}

.resize-handle.height-only:hover {
  border-bottom-color: var(--primary);
}

.collapse-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  z-index: 6;
}

.collapse-handle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.collapsed-layout {
  height: 64px !important;
  min-height: 64px !important;
  overflow: hidden !important;
}

.collapsed-layout > :not(.panel-head):not(h2):not(.collapse-handle):not(.resize-handle) {
  display: none !important;
}

.resizing-layout {
  user-select: none;
  cursor: nwse-resize;
}

.resizing-split {
  user-select: none;
  cursor: col-resize;
}

.resizing-split-vertical {
  user-select: none;
  cursor: row-resize;
}

.resizable-layout {
  max-width: 100%;
}
.lane h2 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 15px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid .wide,
.form-grid label:has(textarea) {
  grid-column: 1 / -1;
}

.approval-rules,
.policy-list {
  display: grid;
  gap: 10px;
}

.settings-extra {
  margin-top: 18px;
}

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

.management-table {
  margin-top: 14px;
}

.approval-rules p,
.policy-list p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.approval-rules span,
.policy-list span {
  color: var(--muted);
  text-align: right;
}

.cleanup-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cleanup-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.compact-policy {
  gap: 8px;
  margin: 12px 0;
}

.compact-policy p {
  padding: 9px 10px;
}

.product-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.product-thumb {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  margin-bottom: 12px;
}

.upload-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.upload-form textarea {
  grid-column: span 3;
  min-height: 42px;
}

.upload-form button {
  min-height: 42px;
}

.check-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.image-manager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.image-manager span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.image-manager b {
  min-width: 32px;
  color: var(--muted);
  font-size: 12px;
}

.image-manager button {
  min-height: 30px;
  padding: 0 8px;
}

.product-info-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.product-info-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.product-info-grid p {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}

.product-info-grid p:last-child {
  margin-bottom: 0;
}

.product-info-grid b {
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
  padding: 0;
  overflow: auto;
}

dialog::backdrop {
  background: rgba(19, 40, 44, 0.52);
}

dialog form {
  padding: 20px;
}

.detail-shell {
  padding: 20px;
}

.detail-shell section {
  min-width: 0;
}

.guide-shell {
  max-width: 980px;
}

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

.guide-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 14px;
}

.guide-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.guide-grid ol,
.guide-grid ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-grid p {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.detail-grid b {
  color: var(--muted);
  font-size: 12px;
}

.detail-text {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.detail-columns h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.detail-section {
  margin-top: 16px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid #cfd8dc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

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

.timeline-item span,
.timeline-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.timeline-item p {
  margin: 4px 0 0;
  color: var(--ink);
}

.timeline-item.done {
  border-left-color: var(--success);
}

.timeline-item.current {
  border-left-color: var(--primary);
  background: #f1fbfa;
}

.timeline-item.failed {
  border-left-color: var(--danger);
  background: #fff7f7;
}

.timeline-item.waiting {
  background: #f8fafb;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 12px 14px 10px;
    box-shadow: 0 10px 24px rgba(10, 28, 31, 0.18);
    transition: padding 180ms ease, box-shadow 180ms ease;
  }

  .brand {
    margin-bottom: 10px;
    transition: margin 180ms ease;
  }

  .mobile-top-menu-collapsed .sidebar {
    padding: 8px 12px;
    box-shadow: 0 6px 18px rgba(10, 28, 31, 0.2);
  }

  .mobile-top-menu-collapsed .brand {
    margin-bottom: 0;
  }

  .mobile-top-menu-collapsed .nav {
    display: none;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 92px;
    text-align: center;
    padding: 9px 10px;
  }

  .metrics,
  .split,
  .board {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .main {
    width: 100%;
    padding: 10px;
  }

  .sidebar {
    padding: 10px 8px 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand small {
    display: none;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .eyebrow {
    font-size: 14px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .topbar-actions,
  .toolbar input {
    max-width: none;
    width: 100%;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .api-status {
    justify-content: center;
  }

  .primary,
  .ghost,
  .icon-button,
  select,
  input,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .panel {
    padding: 12px;
    min-height: auto;
    resize: none;
  }

  .item {
    padding: 14px;
  }

  .lane {
    min-width: 0;
    min-height: auto;
    resize: none;
  }

  .resize-handle,
  .collapse-handle,
  .split-resize-handle {
    display: none;
  }

  .collapsed-layout {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .metrics,
  .detail-grid,
  .detail-columns,
  .guide-grid,
  .product-info-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

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

  dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 8px;
  }

  dialog form,
  .detail-shell {
    padding: 14px;
  }

  .modal-actions,
  .detail-shell .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .modal-actions button,
  .detail-shell .row-actions button,
  .detail-shell .row-actions a {
    width: 100%;
    min-height: 44px;
  }

  .upload-form textarea {
    grid-column: auto;
  }

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

  .metrics article {
    padding: 12px;
  }

  .metrics strong {
    font-size: 28px;
  }

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

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    width: 100%;
  }

  .segmented button {
    min-height: 42px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  .segmented button:last-child,
  .segmented button:nth-last-child(2):nth-child(odd) {
    border-bottom: 0;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .common-system-shortcuts {
    grid-column: 1 / -1;
  }

  .common-system-shortcuts summary {
    min-height: 42px;
    font-size: 14px;
  }

  .common-system-shortcuts__menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .common-system-shortcuts__menu a {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    text-align: center;
    white-space: normal;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 4px;
    font-size: 15px;
    text-align: center;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  td:last-child {
    border-bottom: 0;
  }

  .row-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .row-actions button {
    flex: 1 1 120px;
    min-height: 38px;
  }

  .item-row {
    display: grid;
    gap: 10px;
  }

  .item-row > .badge {
    width: fit-content;
  }
}

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

  .flow-map {
    grid-template-columns: 1fr;
  }

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

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

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .toast,
  .modal-head button,
  .inline-form,
  .row-actions {
    display: none !important;
  }

  .app-shell,
  .main,
  dialog,
  .detail-shell {
    display: block;
    width: 100%;
    max-height: none;
    padding: 0;
    box-shadow: none;
  }

  dialog::backdrop {
    display: none;
  }

  .detail-columns,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Stripe Dashboard inspired admin polish */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --primary: #635bff;
  --primary-dark: #4f46e5;
  --accent: #0f766e;
  --warning: #b45309;
  --success: #047857;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
}

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

.sidebar {
  border-right: 1px solid #e6ebf1;
  background: #ffffff;
  color: var(--ink);
  padding: 18px 14px;
}

.brand {
  padding: 0 8px 14px;
  border-bottom: 1px solid #eef2f7;
}

.brand-mark {
  background: #635bff;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand small {
  color: var(--muted);
}

.nav {
  gap: 2px;
  padding-top: 12px;
}

.nav-item {
  border-radius: 6px;
  color: #475569;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 10px;
}

.nav-item:hover {
  background: #f6f8fb;
  color: var(--ink);
}

.nav-item.active {
  background: #f1f4ff;
  color: #3730a3;
}

.main {
  padding: 24px 28px;
}

.topbar {
  min-height: 56px;
  border-bottom: 1px solid #e6ebf1;
  padding-bottom: 18px;
}

.eyebrow {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

h1 {
  font-size: 24px;
  font-weight: 750;
}

h2 {
  color: #111827;
  font-size: 16px;
  font-weight: 750;
}

.metrics {
  gap: 12px;
}

.metrics article,
.panel,
.item,
tr {
  border-color: #e6ebf1;
  box-shadow: var(--shadow);
}

.metrics article,
.panel {
  border-radius: 8px;
}

.metrics article {
  padding: 16px;
}

.metrics span,
.item-meta,
th {
  color: #64748b;
}

.metrics strong {
  color: #0f172a;
  font-size: 28px;
  font-weight: 760;
}

.panel {
  padding: 16px;
}

.panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
}

.toolbar {
  border: 1px solid #e6ebf1;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

select,
input,
textarea {
  border-color: #d9e1ec;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
}

select:focus,
input:focus,
textarea:focus {
  outline: 2px solid rgba(99, 91, 255, 0.18);
  border-color: #8b85ff;
}

.primary {
  border-color: #635bff;
  background: #635bff;
  color: #fff;
  font-weight: 750;
}

.primary:hover {
  background: #4f46e5;
}

.ghost,
a.link-button,
.link-button,
.api-status,
.icon-button {
  border-color: #d9e1ec;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
}

.ghost:hover,
a.link-button:hover,
.link-button:hover,
.icon-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.api-status.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

table {
  border-color: #e6ebf1;
}

th {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 760;
  text-transform: none;
}

td {
  background: #ffffff;
}

.badge {
  border-radius: 999px;
  font-weight: 750;
}

.badge.pending,
.badge.pending_reflect {
  background: #fff7ed;
  color: #c2410c;
}

.badge.approved,
.badge.done {
  background: #ecfdf5;
  color: #047857;
}

.badge.rejected,
.badge.failed {
  background: #fef2f2;
  color: #dc2626;
}

.badge.draft,
.badge.recalled {
  background: #f1f5f9;
  color: #475569;
}

.segmented {
  border-color: #d9e1ec;
  background: #f8fafc;
}

.segmented button {
  color: #475569;
  font-weight: 700;
}

.segmented button.active {
  background: #ffffff;
  color: #3730a3;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.split-resize-handle::before,
.split-resize-handle.vertical::before {
  background: rgba(99, 91, 255, 0.14);
}

.split-resize-handle::after {
  border-left-color: rgba(99, 91, 255, 0.58);
  border-right-color: rgba(99, 91, 255, 0.58);
}

.split-resize-handle.vertical::after {
  border-top-color: rgba(99, 91, 255, 0.58);
  border-bottom-color: rgba(99, 91, 255, 0.58);
}

.split-resize-handle:hover::before,
.split-resize-handle.vertical:hover::before,
.resizing-split .split-resize-handle::before,
.resizing-split-vertical .split-resize-handle.vertical::before {
  background: rgba(99, 91, 255, 0.24);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.12);
}

.login-screen {
  background: #f7f9fc;
}

.login-card {
  border-color: #e6ebf1;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.common-system-shortcuts {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
  position: static;
}

.common-system-shortcuts__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.common-system-shortcuts__summary::-webkit-details-marker {
  display: none;
}

.common-system-shortcuts__summary::after {
  content: "v";
  color: #64748b;
  font-size: 12px;
}

.common-system-shortcuts[open] .common-system-shortcuts__summary::after {
  content: "^";
}

.common-system-shortcuts__menu {
  display: grid;
  gap: 2px;
  padding: 10px 8px 12px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.common-system-shortcuts__link {
  display: block;
  border-radius: 6px;
  color: #475569;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.common-system-shortcuts__link:hover {
  background: #f6f8fb;
  color: #0f172a;
}

.common-system-shortcuts__link.is-active {
  background: #f1f4ff;
  color: #3730a3;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #e6ebf1;
  }

  .common-system-shortcuts {
    margin: 8px 0 10px;
    border-color: #d9e1ec;
    background: #ffffff;
  }

  .common-system-shortcuts summary {
    min-height: 42px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
  }

  .main {
    width: 100%;
    min-width: 0;
    padding: 14px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 12px;
  }

  .mobile-top-menu-collapsed .nav {
    display: grid;
  }

  .mobile-top-menu-collapsed .nav-item {
    display: none;
  }

  .mobile-top-menu-collapsed .common-system-shortcuts {
    display: block;
    margin-bottom: 0;
  }
}

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

  .topbar-actions,
  .toolbar {
    min-width: 0;
  }

  .topbar-actions > *,
  .toolbar > * {
    max-width: 100%;
  }

  .common-system-shortcuts__summary {
    min-height: 42px;
    font-size: 14px;
  }

  .common-system-shortcuts__menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .common-system-shortcuts__link {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }
}

/* Final mobile navigation guard: keep brand + common shortcut, hide only page menus while collapsed. */
@media (max-width: 980px) {
  .app-shell {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    border-right: 0 !important;
    border-bottom: 1px solid #e6ebf1 !important;
    background: #ffffff !important;
  }

  .sidebar .brand {
    display: flex !important;
    margin-bottom: 8px !important;
    padding-bottom: 10px !important;
  }

  .sidebar > .common-system-shortcuts {
    display: block !important;
    margin: 0 0 8px !important;
  }

  .sidebar > .nav {
    display: grid !important;
  }

  .mobile-top-menu-collapsed .sidebar {
    padding: 8px 10px !important;
  }

  .mobile-top-menu-collapsed .sidebar .brand {
    display: flex !important;
    margin-bottom: 6px !important;
    padding-bottom: 8px !important;
  }

  .mobile-top-menu-collapsed .sidebar > .common-system-shortcuts {
    display: block !important;
    margin-bottom: 0 !important;
  }

  .mobile-top-menu-collapsed .sidebar > .nav {
    display: none !important;
  }

  .mobile-top-menu-collapsed .sidebar .nav-item {
    display: none !important;
  }
}



