* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: #f4f4f2;
  color: #2b2b28;
}

a { color: inherit; }

/* ---- 로그인 화면 ---- */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: #fff;
  border: 1px solid #e2e2de;
  border-radius: 10px;
  padding: 32px;
  width: 320px;
}
.login-box h1 { font-size: 17px; margin: 0 0 6px; }
.login-box .sub { font-size: 12px; color: #888; margin: 0 0 20px; }
.login-box label { display: block; font-size: 12.5px; font-weight: 700; color: #555; margin-top: 12px; }
.login-box input {
  width: 100%; padding: 9px; margin-top: 4px;
  border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}
.login-box button {
  margin-top: 18px; width: 100%; padding: 10px; border: none; border-radius: 6px;
  background: #2e4057; color: #fff; font-weight: 700; cursor: pointer; font-size: 14px;
}
.login-box button:disabled { opacity: .6; cursor: default; }
#msg { font-size: 12.5px; color: #c0392b; margin-top: 10px; min-height: 16px; }
.account-links { margin-top: 14px; text-align: center; font-size: 12px; color: #888; }
.account-links a { color: #2e4057; text-decoration: none; }
.account-links a:hover { text-decoration: underline; }
.account-links span { margin: 0 6px; }

/* ---- 대시보드 셸 ---- */
.app-header {
  background: #2e4057; color: #fff;
  padding: 14px 22px; display: flex; align-items: center; justify-content: space-between;
}
.app-header .title { font-size: 16px; font-weight: 700; }
.app-header .logout-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff;
  padding: 6px 12px; border-radius: 6px; font-size: 12.5px; cursor: pointer;
}

.app-nav {
  display: flex; justify-content: center; gap: 4px; background: #fff; border-bottom: 1px solid #e2e2de;
  padding: 0 16px; overflow-x: auto;
}
.app-nav button {
  border: none; background: transparent; padding: 13px 14px; font-size: 13.5px;
  color: #666; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.app-nav button.active { color: #2e4057; border-bottom-color: #2e4057; font-weight: 700; }

.app-main { padding: 20px 22px; max-width: 1100px; margin: 0 auto; }

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

.placeholder {
  background: #fff; border: 1px dashed #d8d8d3; border-radius: 10px;
  padding: 60px 20px; text-align: center; color: #999; font-size: 13.5px;
}

/* ---- 공용 컴포넌트 ---- */
.card { background: #fff; border: 1px solid #e2e2de; border-radius: 10px; padding: 18px; margin-bottom: 16px; }

.summary-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid #e2e2de; border-radius: 10px; padding: 14px; text-align: center; }
.tile.clickable { cursor: pointer; transition: border-color .15s, transform .1s; }
.tile.clickable:hover { border-color: #2e4057; }
.tile.clickable.active { border-color: #2e4057; background: #eef1f5; }
.tile .num { font-size: 20px; font-weight: 700; color: #2e4057; }
.tile .label { font-size: 12px; color: #888; margin-top: 4px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.plan-card {
  border: 1px solid #e2e2de; border-radius: 10px; padding: 18px 14px; text-align: center;
  display: flex; flex-direction: column; gap: 6px;
}
.plan-name { font-size: 15px; font-weight: 700; color: #2e4057; }
.plan-limit { font-size: 12.5px; color: #666; }
.plan-price { font-size: 19px; font-weight: 700; margin-top: 6px; }
.plan-price-unit { font-size: 12px; font-weight: 400; color: #888; }
.plan-yearly { font-size: 11.5px; color: #999; min-height: 16px; }
.plan-upgrade-btn {
  margin-top: 10px; padding: 8px; border: 1px solid #ccc; border-radius: 6px;
  background: #f4f4f2; color: #999; font-size: 13px; cursor: not-allowed;
}

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-row select, .filter-row input {
  padding: 7px 9px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px;
}
.filter-row button {
  padding: 7px 14px; border: none; border-radius: 6px; background: #2e4057; color: #fff;
  font-size: 13px; cursor: pointer;
}

table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
th, td { padding: 8px 8px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
th { color: #666; font-weight: 700; background: #fafaf8; }
tr:hover td { background: #fafaf8; }

.status-badge { padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.status-입금대기 { background: #fdecea; color: #c0392b; }
.status-주문접수 { background: #e8eef7; color: #2e4057; }
.status-배송준비중 { background: #fff6e0; color: #a8710a; }
.status-발송완료 { background: #e7f6ea; color: #237a3f; }
.status-취소신청 { background: #f3e6d8; color: #a8590a; }
.status-취소완료 { background: #eee; color: #555; }

.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.row-actions button {
  border: 1px solid #d8d8d3; background: #fff; border-radius: 5px; padding: 3px 8px;
  font-size: 11.5px; cursor: pointer;
}
.row-actions button:hover { background: #f4f4f2; }
.row-actions button.danger { color: #c0392b; border-color: #f0c4bd; }

.delete-cell { text-align: center; width: 36px; }
.row-hover-delete {
  width: 22px; height: 22px; line-height: 20px; padding: 0; text-align: center;
  border: 1px solid #f0c4bd; border-radius: 50%; background: #fff; color: #c0392b;
  font-size: 13px; font-weight: 700; cursor: pointer; opacity: 0; transition: opacity .1s;
}
.order-row:hover .row-hover-delete,
.row-hover-delete:focus { opacity: 1; }
.row-hover-delete:hover { background: #fdecea; }

.empty-msg { padding: 30px; text-align: center; color: #999; font-size: 13px; }
.table-scroll { overflow-x: auto; }

/* 운송장 인라인 입력 */
.tracking-input {
  width: 110px; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px;
  font-size: 12.5px; background: transparent;
}
.tracking-input:hover { border-color: #ddd; }
.tracking-input:focus { border-color: #2e4057; background: #fff; outline: none; }

/* 전화주문 수동입력 그리드 */
.hint { font-size: 12px; color: #888; margin: 0 0 10px; }
#manualOrderBody { cursor: text; }
#manualOrderTable td[data-col] {
  min-width: 80px;
}
#manualOrderBody:focus,
#ordersBody:focus {
  outline: none;
}
#manualOrderTable td[data-col]::selection,
#manualOrderTable td[data-col] *::selection,
#ordersBody td::selection,
#ordersBody td *::selection {
  background: #cfe0ee;
}
.mo-status { font-size: 11.5px; color: #888; white-space: nowrap; }
.row-del-btn {
  border: 1px solid #d8d8d3; background: #fff; border-radius: 5px; padding: 3px 8px;
  font-size: 11.5px; cursor: pointer; color: #c0392b;
}
