/* ==========================================================================
   Unified design for member pages (loaded after styles.css).
   One palette, one radius scale, one card / table / tab / button style, so
   마이페이지, 구매레시피, 장바구니, 포인트, 쪽지함, 1:1문의, 정보수정, 추천인,
   판매수익 and 파트너 신청 look like the boards and the recipe library.
   ========================================================================== */
:root {
  --brand: #1f5f3a;
  --brand-2: #2f7a45;
  --brand-soft: #f3f7ef;
  --brand-line: #dfe9da;
  --card-radius: 16px;
  --control-radius: 10px;
  --card-shadow: 0 6px 20px #1f2a1c0d;
}

/* ---- Page frame ---- */
.content-page.ui-page { max-width: 1080px; }
.ui-page .ui-hero { margin: 0 0 22px; }
.ui-page .credit-history, .ui-page .credit-section, .ui-page .points-history, .ui-page .ct-page,
.ui-page .er-page, .ui-page .sp-board, .ui-page .message-box, .ui-page .profile-edit-form,
.ui-page .mp-top, .ui-page .mp-section, .ui-page .pt-video, .ui-page .partner-page { max-width: none; width: auto; }

/* ---- Cards ---- */
.ui-page .mp-section, .ui-page .credit-card, .ui-page .er-card, .ui-page .profile-panel,
.ui-page .message-box, .ui-page .mp-info {
  background: #fff; border: 1px solid var(--line); border-radius: var(--card-radius); box-shadow: var(--card-shadow);
}
.ui-page .mp-section { padding: 20px 22px; margin: 0 0 18px; }
.ui-page .mp-section > h2, .ui-page .er-card > h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.3px; color: var(--ink); }
.ui-page .mp-more { margin-top: 12px; text-align: right; }
.ui-page .mp-more a, .ui-page .credit-more { display: inline-flex; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; font-weight: 700; color: #59605b; text-decoration: none; }
.ui-page .mp-more a:hover, .ui-page .credit-more:hover { border-color: var(--brand-2); color: var(--brand); }

/* Section headings with a small green bar instead of the old red chef dot. */
.ui-page .credit-section { margin: 0 0 18px; }
.ui-page .credit-section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.ui-page .credit-section-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; }
.ui-page .credit-section-head h2 svg, .ui-page .credit-section-head h2 img { display: none; }
.ui-page .credit-section-head h2::before, .ui-page .mp-section > h2::before, .ui-page .er-card > h2::before {
  content: ""; display: inline-block; width: 4px; height: 16px; margin-right: 8px; border-radius: 2px; background: var(--brand-2); vertical-align: -2px;
}
.ui-page .credit-card { padding: 20px 22px; border-width: 1px; }

/* ---- Tables: light header, soft rows ---- */
.ui-page .mp-table-wrap, .ui-page .credit-table-wrap, .ui-page .points-table-wrap, .ui-page .er-table-wrap, .ui-page .sp-table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.ui-page .mp-table, .ui-page .credit-table, .ui-page .points-table, .ui-page .er-table, .ui-page .sp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ui-page .mp-table thead th, .ui-page .credit-table thead th, .ui-page .points-table thead th, .ui-page .er-table thead th, .ui-page .sp-table thead th {
  background: var(--pale); color: #4d5550; font-weight: 700; font-size: 12.5px; padding: 11px 10px; border-bottom: 1px solid var(--line); border-top: 0;
}
.ui-page .mp-table td, .ui-page .credit-table td, .ui-page .points-table td, .ui-page .er-table td, .ui-page .sp-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
.ui-page .mp-table tbody tr:last-child td, .ui-page .credit-table tbody tr:last-child td, .ui-page .points-table tbody tr:last-child td,
.ui-page .er-table tbody tr:last-child td, .ui-page .sp-table tbody tr:last-child td { border-bottom: 0; }
.ui-page .mp-table tbody tr:hover td, .ui-page .credit-table tbody tr:hover td, .ui-page .points-table tbody tr:hover td,
.ui-page .er-table tbody tr:hover td, .ui-page .sp-table tbody tr:hover td { background: #fafbf8; }
.ui-page .points-table tfoot th, .ui-page .points-table tfoot td { background: var(--brand-soft); color: var(--brand); font-weight: 800; padding: 12px 10px; border-top: 1px solid var(--brand-line); }
.ui-page .mp-empty, .ui-page .er-empty, .ui-page .credit-empty { padding: 36px 12px !important; text-align: center; color: var(--muted); }
.ui-page .mp-table img { border-radius: 8px; }

/* ---- Pill tabs (구매레시피, 쪽지함, 1:1문의) ---- */
.ui-page .pc-tabs, .ui-page .message-tabs, .ui-page .sp-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; width: fit-content; max-width: 100%; margin: 0 0 14px; padding: 4px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--pale);
}
.ui-page .pc-tabs a, .ui-page .message-tabs a, .ui-page .sp-tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; border: 0; border-radius: 999px; background: transparent;
  font-size: 13.5px; font-weight: 700; color: #59605b; text-decoration: none; min-width: 0;
}
.ui-page .pc-tabs a.selected, .ui-page .message-tabs a.active, .ui-page .sp-tabs a[aria-current="page"] { background: var(--brand); color: #fff; box-shadow: 0 3px 10px #1f5f3a33; }
.ui-page .message-tabs a svg { width: 15px; height: 15px; }

/* ---- Buttons: primary stays accent, secondary becomes an outlined pill ---- */
.ui-page .primary-button, .ui-page .credit-submit, .ui-page .pt-button.primary { border-radius: var(--control-radius); }
.ui-page .message-button, .ui-page .sp-button, .ui-page .er-button, .ui-page .rv-small-button, .ui-page .pt-button:not(.primary) {
  border: 1px solid var(--line); border-radius: var(--control-radius); background: #fff; color: var(--ink); font-weight: 700;
}
.ui-page .message-button:hover, .ui-page .sp-button:hover, .ui-page .er-button:hover, .ui-page .rv-small-button:hover { border-color: var(--brand-2); color: var(--brand); }

/* ---- Form controls ---- */
.ui-page input:not([type=checkbox]):not([type=radio]), .ui-page select, .ui-page textarea { border-radius: var(--control-radius); }
.ui-page input:focus, .ui-page select:focus, .ui-page textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px #2f7a451f; }

/* ---- 마이페이지 ---- */
.ui-page .mp-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 0 0 18px; }
.ui-page .mp-info { padding: 6px 20px 10px; overflow: hidden; }
.ui-page .mp-info h2 { margin: 12px 0 6px; font-size: 16px; }
.ui-page .mp-info dl > div, .ui-page .mp-info .mp-row { border-color: var(--line); }
.ui-page .mp-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.ui-page .mp-shortcuts a {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 58px; padding: 10px 8px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 700; text-align: center; text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ui-page .mp-shortcuts a:hover { border-color: var(--brand-2); color: var(--brand); transform: translateY(-2px); box-shadow: var(--card-shadow); }
.ui-page .mp-shortcuts a b { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; }
.ui-page .my-posts { padding: 20px 22px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; }
.ui-page .signout-row { border-top: 0; }

/* ---- 포인트 충전 ---- */
.ui-page .credit-balance-line p { font-size: 17px; }
.ui-page .credit-accent { color: var(--brand); }
.ui-page .credit-method.active { border-color: var(--brand-2); color: var(--brand); border-radius: 999px; }
.ui-page .credit-notes { padding: 12px 14px; border-radius: 12px; background: var(--pale); }
.ui-page .credit-account { padding: 12px 14px; border: 1px solid var(--brand-line); border-radius: 12px; background: var(--brand-soft); }
.ui-page .credit-quick button, .ui-page .credit-amounts button { border-radius: 999px; }

/* ---- 쪽지함 ---- */
.ui-page .message-box { overflow: hidden; }
.ui-page .message-head { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); padding: 16px 20px; }
.ui-page .message-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.ui-page .message-head span { color: var(--muted); }

/* ---- 1:1문의 ---- */
.ui-page .sp-toolbar { align-items: center; }
.ui-page .sp-count { border-radius: 999px; border-color: var(--line); background: #fff; }
.ui-page .sp-table thead th { border-top: 0; }
.ui-page .sp-heading { font-size: 20px; margin: 0 0 14px; }

/* ---- 정보수정 ---- */
.ui-page .profile-panel { overflow: hidden; margin: 0 0 18px; }
.ui-page .profile-panel > h2 { background: #fff; border-bottom: 1px solid var(--line); color: var(--ink); }
.ui-page .profile-panel > h2 svg { color: var(--brand-2); }
.ui-page .profile-static { border-radius: var(--control-radius); }

/* ---- 판매수익 · 추천인 ---- */
.ui-page .er-page > h1 { display: none; }
.ui-page .er-totals > div { border-radius: 14px; border-color: var(--line); box-shadow: var(--card-shadow); }
.ui-page .er-totals .pending b { color: var(--accent); }
.ui-page .er-card { padding: 20px 22px; margin: 0 0 18px; }

/* ---- 장바구니 ---- */
.ui-page .ct-list { border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; overflow: hidden; }
.ui-page .ct-empty { padding: 50px 16px; border: 1px dashed var(--line); border-radius: var(--card-radius); background: #fff; }
.ui-page .ct-summary { border-radius: var(--card-radius); border-color: var(--line); background: var(--brand-soft); }

/* ---- 파트너 신청: brand green poster instead of the yellow form look ---- */
.ui-page .pt-hero, .ui-page .partner-hero { background: linear-gradient(135deg, #1f5f3a 0%, #2f7a45 60%, #e9a23b 150%); color: #fff; border-radius: 20px; }
.ui-page .pt-hero h1, .ui-page .pt-hero h2, .ui-page .partner-hero h1, .ui-page .partner-hero h2 { color: #fff; }
.ui-page .pt-question, .ui-page .pt-card { border-radius: 14px; border-color: var(--line); box-shadow: none; }
.ui-page .pt-question:focus-within, .ui-page .pt-card:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px #2f7a451a; }

/* ---- Phones ---- */
@media (max-width: 760px) {
  .ui-page .mp-top { grid-template-columns: 1fr; }
  .ui-page .mp-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ui-page .mp-section, .ui-page .credit-card, .ui-page .er-card, .ui-page .my-posts { padding: 16px; }
  .ui-page .pc-tabs, .ui-page .message-tabs, .ui-page .sp-tabs { width: auto; }
}

/* ---- Detail pass: brand colours instead of the old blue, consistent inner boxes and buttons ---- */
.ui-page .credit-accent, .ui-page .credit-amount output, .ui-page .credit-amount-text, .ui-page .er-links small,
.ui-page .mp-charge b, .ui-page .mp-points b, .ui-page .ct-list b { color: var(--brand); }
.ui-page .mp-info h2 { background: #fff; padding: 14px 0 10px; margin: 0; }
.ui-page .mp-charge { border: 1px solid var(--brand-line); border-radius: 12px; background: var(--brand-soft); }
.ui-page .my-posts h2 { font-size: 17px; margin: 0 0 12px; }
.ui-page .my-posts h2::before { content: ""; display: inline-block; width: 4px; height: 16px; margin-right: 8px; border-radius: 2px; background: var(--brand-2); vertical-align: -2px; }
.ui-page .credit-cancel, .ui-page .profile-cancel { border: 1px solid var(--line); border-radius: var(--control-radius); background: #fff; color: var(--ink); }
.ui-page .credit-cancel:hover, .ui-page .profile-cancel:hover { border-color: var(--brand-2); color: var(--brand); }
.ui-page .profile-save, .ui-page .profile-submit { border-radius: var(--control-radius); }
.ui-page .points-table tfoot .points-balance { background: var(--brand-soft); }
.ui-page .points-note a { display: inline-flex; padding: 9px 18px; border-radius: var(--control-radius); background: var(--accent); color: #fff; font-weight: 800; text-decoration: none; }
.ui-page .message-tabs { margin: 14px 20px 0; }

/* Partner poster: translucent panels on the green, yellow labels, bordered form fields. */
.ui-page .pt-lead, .ui-page .pt-shares li { background: #0f2e1d73; border: 1px solid #ffffff26; }
.ui-page .pt-tags { background: #ffd35a; color: #1f2a1c; }
.ui-page .pt-facts dt { color: #ffd35a; }
.ui-page .pt-facts dd { color: #eef7f0; }
.ui-page .pt-question input, .ui-page .pt-question textarea, .ui-page .pt-grid input {
  border: 1px solid var(--line); border-radius: var(--control-radius); padding: 10px 12px; background: #fff;
}
.ui-page .pt-question legend { color: var(--ink); }
.ui-page .pt-button.primary { background: var(--accent); border-color: var(--accent); border-radius: var(--control-radius); }
/* Shortcut tiles: the count badge sits on the corner so labels stay on one line. */
.ui-page .mp-shortcuts a { white-space: nowrap; }
.ui-page .mp-shortcuts a b { position: absolute; top: -6px; right: -6px; box-shadow: 0 2px 6px #0002; }
@media (max-width: 760px) { .ui-page .mp-shortcuts a { font-size: 12.5px; min-height: 52px; padding: 8px 4px; } }

/* ---- Menu items limited to an audience ---- */
.menu-only-partner, .menu-only-admin, .menu-only-member { display: none !important; }
html.signed-in .menu-only-member, html.is-partner .menu-only-partner, html.is-admin .menu-only-admin { display: revert !important; }
html.signed-in .menu-only-guest { display: none !important; }
.menu-directory .menu-section { list-style: none; margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 800; color: #9aa09b; }
.menu-directory ul > .menu-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* ---- 사용설명서 ---- */
.guide-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: guide; }
.guide-steps li { counter-increment: guide; position: relative; padding: 14px 16px 14px 56px; border: 1px solid var(--line); border-radius: 14px; background: #fff; line-height: 1.6; color: #4d5550; }
.guide-steps li::before { content: counter(guide); position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; }
.guide-steps strong { display: block; color: var(--ink); }
html.is-admin .customer-shortcut.menu-only-admin, html.is-partner .customer-shortcut.menu-only-partner{display:flex !important}
html.is-partner .menu-only-nonpartner { display: none !important; }

/* ---- 파트너 센터 ---- */
.pc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.pc-bar .pc-tabs { margin: 0; }
.pc-earnings { font-size: 13.5px; font-weight: 700; color: var(--brand); text-decoration: none; }
.pc-card { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; box-shadow: var(--card-shadow); }
.pc-card h2 { margin: 0 0 8px; font-size: 18px; }
.pc-locked, .pc-empty { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 40px 20px; }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pc-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; }
.pc-item img { width: 120px; height: 84px; object-fit: cover; border-radius: 10px; }
.pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-top strong { font-size: 16px; }
.pc-status { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.pc-status.pending { background: #fff1e3; color: #b4581a; }
.pc-status.approved { background: #e6f2ea; color: #1f6b3a; }
.pc-status.rejected { background: #fde8e3; color: #c2381b; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; color: #59605b; }
.pc-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: #fdf1ee; font-size: 13px; color: #8a2f1c; }
.pc-note b { margin-right: 6px; }
.pc-action { padding: 9px 14px; border-radius: var(--control-radius); background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.pc-action.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.pc-help { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.pc-form { display: grid; gap: 14px; }
.pc-field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.pc-field input, .pc-field select, .pc-field textarea { border: 1px solid var(--line); padding: 10px 12px; font: inherit; font-weight: 400; background: #fff; }
.pc-field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.pc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pc-fieldset { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pc-fieldset legend { padding: 0 6px; font-size: 13px; font-weight: 700; }
.pc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.pc-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .pc-item { grid-template-columns: 84px minmax(0, 1fr); }
  .pc-item img { width: 84px; height: 64px; }
  .pc-item .pc-action { grid-column: 1 / -1; text-align: center; }
  .pc-grid { grid-template-columns: 1fr 1fr; }
}
/* Sidebar: partners carry a green badge and ring. */
.sidebar-member.is-partner .member-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-2); }
.sidebar-member.is-partner .member-role { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e6f2ea; color: #1f6b3a; font-weight: 800; }
/* Operator lists */
.status-pill.review-pending { background: #fff1e3; color: #b4581a; }
.status-pill.review-rejected { background: #fde8e3; color: #c2381b; }
.role-tag.partner { background: #e6f2ea; color: #1f6b3a; }
.sidebar-member-links a[href="#/partner"] { background: var(--brand); color: #fff; font-weight: 800; }
.sidebar-member-links a[href="#/partner"]:hover { background: var(--brand-2); }
