:root {
  --blue: #347ff0;
  --blue-dark: #2467cc;
  --ink: #111827;
  --muted: #7b879f;
  --line: #dce2ec;
  --surface: #ffffff;
  --background: #f4f6fa;
  --danger: #ef4056;
  --success: #24ae6b;
  --warning: #f4a621;
  --shadow: 0 12px 36px rgba(21, 40, 78, 0.08);
}

* { box-sizing: border-box; }
html { font-family: Inter, Pretendard, "Noto Sans KR", Arial, sans-serif; color: var(--ink); }
body { margin: 0; background: var(--background); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1330px) / 2));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -.03em; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #7768ff, #2f7df2);
  box-shadow: 0 7px 18px rgba(70, 103, 238, .3);
}
.topbar nav { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 700; color: #48546b; }
.topbar nav a:hover { color: var(--blue); }
.balance { background: #edf4ff; color: var(--blue-dark); padding: 8px 12px; border-radius: 20px; }
.inline-form, .inline-actions, .balance-form { display: inline-flex; margin: 0; gap: 7px; align-items: center; }
.link-button { padding: 0; border: 0; background: none; color: #68758d; font-weight: 700; }

.page { max-width: 1330px; margin: 0 auto; padding: 48px 24px 90px; }
.flash-stack { position: fixed; top: 82px; left: 50%; transform: translateX(-50%); width: min(92%, 650px); z-index: 30; }
.flash { padding: 14px 18px; border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow); background: white; font-size: 14px; font-weight: 700; }
.flash-success { border-left: 4px solid var(--success); }
.flash-error { border-left: 4px solid var(--danger); }
.flash-warning { border-left: 4px solid var(--warning); }

.hero {
  min-height: 250px;
  padding: 42px 52px;
  border-radius: 26px;
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.22), transparent 25%),
    linear-gradient(120deg, #242f70, #405ee5 54%, #54a2ff);
  box-shadow: 0 22px 50px rgba(54, 83, 191, .2);
}
.hero h1 { margin: 8px 0 12px; font-size: clamp(32px, 4vw, 52px); line-height: 1.13; letter-spacing: -.045em; }
.hero p { margin: 0; color: #dce7ff; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.hero .eyebrow { color: #b9d1ff; }

.category-section { margin-top: 62px; }
.section-heading { display: flex; justify-content: space-between; margin-bottom: 21px; }
.section-heading h2 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.035em; }
.section-heading span { font-size: 13px; color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: .2s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-image {
  height: 170px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: white;
  background:
    radial-gradient(circle at 65% 25%, rgba(255,255,255,.28), transparent 22%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent), white 22%), var(--accent));
}
.product-image::after, .detail-image::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255,255,255,.16);
  transform: rotate(35deg);
  border-radius: 32px;
}
.product-image img, .detail-image img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 2; }
.product-symbol { position: relative; z-index: 2; font-size: 52px; font-weight: 1000; font-style: italic; text-shadow: 0 8px 22px rgba(0,0,0,.18); }
.product-image-label { position: absolute; bottom: 18px; left: 20px; z-index: 2; font-size: 12px; font-weight: 800; opacity: .8; }
.product-card-body { padding: 19px 18px 18px; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { padding: 5px 8px; background: #f1f3f7; color: #8a94a8; border-radius: 20px; font-size: 11px; font-weight: 800; }
.tag-blue { background: #edf4ff; color: var(--blue); }
.tag-green { background: #e6f8ee; color: #19a35f; }
.tag-red { background: #ffedf0; color: var(--danger); }
.product-card h3 { min-height: 47px; margin: 13px 0 18px; font-size: 17px; line-height: 1.4; letter-spacing: -.02em; }
.card-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
del { display: block; color: #9aa4b6; font-size: 12px; margin-bottom: 3px; }
.card-bottom strong { color: #ed2e43; font-size: 21px; }
.admin-card-actions { display: flex; gap: 15px; margin-top: 17px; padding-top: 14px; border-top: 1px solid #edf0f5; font-size: 12px; color: var(--blue); font-weight: 800; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-light { background: white; color: #2c55bf; }
.btn-secondary { background: #edf0f5; color: #68758d; border: 1px solid #dce2eb; }
.btn-outline { background: white; color: #4f5e78; border: 1px solid var(--line); }
.btn-success { background: #e5f8ee; color: #138c50; }
.btn-danger { background: #ffe8ec; color: #db2941; }
.btn-disabled, .btn:disabled { background: #e9edf3; color: #9ba5b7; cursor: not-allowed; }
.btn-large { width: 100%; padding: 15px 18px; font-size: 15px; }
.btn-small { padding: 7px 10px; font-size: 12px; border-radius: 8px; }

.back-link { display: inline-block; color: #7f8ba0; margin-bottom: 26px; font-size: 14px; font-weight: 700; }
.detail-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, .95fr); background: white; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.detail-left { min-width: 0; border-right: 1px solid var(--line); }
.detail-image {
  height: 430px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: white;
  background:
    radial-gradient(circle at 65% 25%, rgba(255,255,255,.28), transparent 22%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent), white 30%), var(--accent));
}
.product-symbol-large { font-size: 110px; }
.detail-image > span:last-child { position: absolute; bottom: 40px; z-index: 2; opacity: .8; font-weight: 800; }
.description { min-height: 165px; padding: 27px 32px; line-height: 1.8; color: #40506b; }
.description h4 { margin: 0 0 7px; font-size: 12px; color: #77839b; }
.description p { margin: 0; white-space: normal; }
.detail-panel { padding: 54px 34px; }
.detail-panel h1 { margin: 12px 0 10px; font-size: 27px; letter-spacing: -.04em; }
.detail-panel > del { margin-top: 28px; }
.detail-price { margin: 3px 0 28px; font-size: 32px; font-weight: 900; letter-spacing: -.04em; }
.purchase-form { border-top: 1px solid var(--line); padding-top: 16px; }
.quantity-row, .total-row, .order-meta { display: flex; justify-content: space-between; align-items: center; }
.quantity-row { min-height: 57px; font-weight: 800; }
.quantity-control { display: flex; align-items: center; gap: 13px; }
.quantity-control button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #f4f6fa; font-weight: 900; }
.quantity-control input { width: 32px; border: 0; background: transparent; text-align: center; font-weight: 900; }
.total-row { margin: 12px 0 16px; background: #f0f2f6; border-radius: 12px; padding: 18px 15px; color: #475570; font-size: 13px; font-weight: 800; }
.total-row strong { color: var(--blue); font-size: 22px; }
.purchase-form .btn + .btn { margin-top: 8px; }
.admin-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

.auth-body { min-height: 100vh; background: linear-gradient(135deg, #eef2fb, #f8f9fc); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; }
.auth-card { width: min(100%, 430px); background: white; border: 1px solid var(--line); border-radius: 24px; padding: 38px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 30px; }
.brand-mark-large { width: 54px; height: 54px; border-radius: 16px; font-size: 24px; }
.auth-brand p { margin: 17px 0 5px; color: var(--blue); font-size: 10px; letter-spacing: .16em; font-weight: 900; }
.auth-brand h1 { margin: 0 0 7px; font-size: 30px; }
.auth-brand > span:last-child, .muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-card > h1 { margin: 0 0 9px; }
.auth-link { text-align: center; color: var(--muted); font-size: 14px; margin: 22px 0 0; }
.auth-link a { color: var(--blue); font-weight: 800; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 800; color: #4c5971; }
.form-stack input, .form-stack textarea, .balance-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
}
.form-stack input:focus, .form-stack textarea:focus, .balance-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #e9f2ff; }
.form-stack small, td small { display: block; margin-top: 4px; color: #96a0b2; font-size: 11px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.checkbox-label { flex-direction: row !important; align-items: center; }
.checkbox-label input { width: auto; }

.narrow-page { max-width: 720px; margin: 0 auto; }
.panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 8px 25px rgba(35, 53, 91, .04); }
.panel h1 { margin: 8px 0 8px; font-size: 30px; letter-spacing: -.04em; }
.panel h2 { margin: 0 0 20px; font-size: 20px; }
.bank-box { display: flex; flex-direction: column; gap: 7px; margin: 24px 0; padding: 23px; border-radius: 14px; background: linear-gradient(135deg, #edf4ff, #f3efff); color: #55637e; }
.bank-box strong { color: #263864; font-size: 25px; letter-spacing: .04em; }
.notice { padding: 13px 15px; border-radius: 10px; background: #fff7e5; color: #9b6d13; font-size: 12px; line-height: 1.6; }
.order-meta { padding: 18px 0; margin: 18px 0 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-meta strong { color: var(--blue); font-size: 21px; }
.delivery-box { white-space: pre-wrap; word-break: break-all; background: #182033; color: #dbe7ff; padding: 22px; border-radius: 12px; line-height: 1.8; min-height: 120px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; }
.page-heading h1 { margin: 7px 0 0; font-size: 34px; letter-spacing: -.045em; }
.table-panel { margin-top: 22px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 13px; }
th { text-align: left; padding: 12px 13px; background: #f5f7fa; color: #77839a; font-size: 11px; }
td { padding: 14px 13px; border-bottom: 1px solid #edf0f4; color: #4b5870; }
tr:last-child td { border-bottom: 0; }
td strong { color: #202a3d; }
td a, .panel-heading a, .action-links a { color: var(--blue); font-weight: 800; }
.empty-cell, .empty-state { padding: 45px; text-align: center; color: #96a0b2; }
.status { display: inline-block; padding: 5px 9px; border-radius: 20px; font-size: 11px; font-weight: 800; }
.status-pending { background: #fff3db; color: #b57909; }
.status-approved { background: #e5f8ee; color: #138c50; }
.status-rejected { background: #ffe8ec; color: #d72d45; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.stat-card strong { font-size: 24px; letter-spacing: -.03em; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; }
.balance-form input { width: 125px; padding: 8px; }
.action-links { display: flex; gap: 12px; }
.admin-two-column { display: grid; grid-template-columns: .85fr 1.15fr; gap: 22px; align-items: start; }
.inventory-list { max-height: 560px; overflow: auto; }
.inventory-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf0f4; }
.inventory-item > div { min-width: 0; }
.inventory-item code { display: block; margin-top: 8px; word-break: break-all; color: #48546b; }
.danger-text { color: var(--danger); }

@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-card { grid-template-columns: 1.4fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-two-column { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: auto; padding: 14px 18px; align-items: flex-start; }
  .topbar nav { justify-content: flex-end; flex-wrap: wrap; gap: 10px 14px; }
  .topbar nav > a:first-child { display: none; }
  .page { padding: 28px 15px 70px; }
  .hero { min-height: 220px; padding: 30px 25px; align-items: flex-start; flex-direction: column; }
  .hero h1 { font-size: 34px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-image { height: 135px; }
  .product-card-body { padding: 14px; }
  .detail-card { display: block; }
  .detail-left { border-right: 0; }
  .detail-image { height: 280px; }
  .detail-panel { padding: 30px 22px; }
  .page-heading { align-items: flex-start; gap: 15px; }
  .page-heading h1 { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
}

@media (max-width: 480px) {
  .brand > span:last-child { display: none; }
  .topbar nav { font-size: 12px; }
  .balance { padding: 6px 8px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-image { height: 180px; }
  .stat-grid { grid-template-columns: 1fr; }
  .admin-detail-actions { grid-template-columns: 1fr; }
}

