:root {
  --ink: #16212f;
  --muted: #667085;
  --line: #d8dde7;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --brand: #17456f;
  --brand-strong: #0d2f4f;
  --accent: #d64032;
  --shadow: 0 24px 70px rgba(13, 47, 79, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    "Pretendard",
    "Noto Sans KR",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(23, 69, 111, 0.92), rgba(13, 47, 79, 0.94)),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.22), transparent 28%),
    #0d2f4f;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-panel {
  width: min(100%, 420px);
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.brand-mark {
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-mark.compact {
  margin-bottom: 8px;
  font-size: 12px;
}

.login-panel h1 {
  margin: 16px 0 8px;
  font-size: 34px;
  line-height: 1.1;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.login-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 69, 111, 0.12);
}

.login-form button,
.user-box button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.login-form button:disabled {
  cursor: progress;
  opacity: 0.66;
}

.form-message {
  min-height: 22px;
  color: var(--accent) !important;
  font-size: 13px;
  font-weight: 700;
}

.app-page {
  min-height: 100vh;
  background: var(--surface-soft);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.app-header h1,
.summary-band h2,
.work-panel h2 {
  margin: 0;
}

.app-header h1 {
  font-size: 24px;
  line-height: 1.2;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.user-box button {
  min-height: 38px;
  padding: 0 16px;
  background: var(--brand-strong);
}

.app-main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.app-content {
  min-width: 0;
}

.app-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.side-nav {
  position: sticky;
  top: 18px;
  display: grid;
  align-content: start;
  gap: 8px;
  height: fit-content;
  margin-bottom: 0;
  overflow: visible;
}

.tab-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.side-nav .tab-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 42px;
  padding: 0 14px;
}

.tab-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.summary-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 8px;
  background: var(--brand-strong);
  color: #fff;
}

.summary-band h2 {
  font-size: 28px;
}

.summary-band p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.summary-band time {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  white-space: nowrap;
}

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

.metric-card,
.work-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  min-height: 120px;
  padding: 22px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  color: var(--brand);
  font-size: 38px;
  line-height: 1;
}

.work-panel {
  margin-top: 18px;
  padding: 26px 28px;
}

.work-panel h2 {
  font-size: 20px;
}

.work-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.work-panel ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

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

.panel-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-titlebar h2 {
  margin: 0;
}

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

.member-create-form {
  grid-template-columns: 1.1fr 1.1fr 1.1fr 0.8fr auto;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.business-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.span-2 {
  grid-column: span 2;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.member-table input,
.member-table select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.form-grid textarea {
  min-height: 76px;
  resize: vertical;
  padding: 10px;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.member-table input:focus,
.member-table select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 69, 111, 0.1);
}

.form-grid button,
.member-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.ghost-button {
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: var(--brand-strong) !important;
}

.inline-message {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inline-message[data-state="success"] {
  color: #157347;
}

.inline-message[data-state="error"] {
  color: var(--accent);
}

.photo-preview-panel:empty {
  display: none;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-preview-item {
  display: grid;
  gap: 6px;
  margin: 0;
}

.photo-preview-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.photo-preview-item figcaption {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.photo-preview-item figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

.member-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 14px;
}

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

.member-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.member-actions {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  gap: 8px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.check-label input {
  flex: 0 0 auto;
  width: auto;
  min-height: auto;
  margin: 0;
}

.self-label {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(23, 69, 111, 0.1);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.account-panel {
  max-width: 560px;
}

.password-form {
  margin-top: 18px;
}

.data-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.data-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.data-card-main {
  display: grid;
  gap: 7px;
}

.data-card-main strong {
  color: var(--ink);
  font-size: 16px;
}

.data-card-main span,
.data-card-main small,
.data-card-side small {
  color: var(--muted);
  font-size: 13px;
}

.data-card-main p {
  margin: 0;
  color: var(--ink);
}

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.account-photo {
  width: 112px;
  margin: 0;
}

.account-photo img {
  display: block;
  width: 112px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.account-photo figcaption {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.account-photo figcaption button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.data-card-side {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 9px;
  color: var(--muted);
}

.data-card-side select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(23, 69, 111, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.small-action {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 11px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.secondary-action {
  background: var(--brand) !important;
}

.danger-action {
  background: #b42318 !important;
  color: #fff !important;
}

.empty-text {
  margin: 0;
  color: var(--muted);
}

.product-search-box,
.quote-item-box {
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.product-results,
.quote-item-list,
.mini-items {
  display: grid;
  gap: 8px;
}

.product-result {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.product-result span,
.quote-item-row small,
.mini-items span {
  color: var(--muted);
  font-size: 12px;
}

.quote-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quote-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 72px 110px 100px auto;
  gap: 8px;
  align-items: center;
}

.quote-item-row input {
  min-height: 34px;
}

.quote-item-row button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 760px) {
  .login-panel {
    padding: 30px 24px;
  }

  .app-header,
  .summary-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-box {
    width: 100%;
    justify-content: space-between;
  }

  .summary-band time {
    white-space: normal;
  }

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

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

  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 760px);
    padding-top: 18px;
  }

  .side-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .side-nav .tab-button {
    width: auto;
  }

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

  .span-2 {
    grid-column: span 1;
  }

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

  .data-card-side {
    justify-items: start;
  }
}

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