:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --line: #d1d5db;
  --primary: #374151;
  --primary-hover: #1f2937;
  --accent: #2563eb;
  --success: #047857;
  --danger: #b91c1c;
  --warning: #b45309;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
html.auth-pending body { visibility: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #111827; color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.header-row { min-height: 64px; display: flex; align-items: center; gap: 22px; }
.brand { color: #fff; font-weight: 800; font-size: 20px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.main-nav a { color: #e5e7eb; padding: 8px 10px; border-radius: 7px; font-size: 14px; }
.main-nav a:hover, .main-nav a.active { background: #374151; color: #fff; text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.page { padding: 28px 0 56px; }
.page-title { margin: 0 0 6px; font-size: 28px; line-height: 1.2; }
.page-subtitle { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--surface); border: 1px solid #e5e7eb; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px; background: var(--surface); border: 1px solid #e5e7eb; border-radius: var(--radius); }
.stat-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { margin-top: 5px; font-size: 26px; font-weight: 800; }
.dashboard-link { display: block; color: var(--text); padding: 22px; background: var(--surface); border: 1px solid #dbe1e8; border-radius: var(--radius); box-shadow: var(--shadow); }
.dashboard-link:hover { border-color: #9ca3af; text-decoration: none; transform: translateY(-1px); }
.dashboard-link h2 { margin: 0 0 6px; font-size: 20px; }
.dashboard-link p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.results-count { font-size: 18px; font-weight: 700; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fff; font-weight: 800; border-bottom: 2px solid #bfc4c9; }
.product-name { font-weight: 800; color: #050505; }
.price { font-weight: 800; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: #cbd5e1; color: #1f2937; }
.btn-secondary:hover { background: #f8fafc; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.checkbox-row { display: flex; gap: 9px; align-items: flex-start; }
.checkbox-row input { width: auto; margin-top: 5px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); background: #fff; padding: 30px; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid #e5e7eb; }
.auth-card h1 { margin-top: 0; }
.muted { color: var(--muted); }
.notice { border-radius: 8px; padding: 12px 14px; margin: 14px 0; border: 1px solid; }
.notice-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.notice-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.notice-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.notice-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: #e5e7eb; color: #374151; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 420px; padding: 12px 16px; color: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.toast-success { background: #047857; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1d4ed8; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; }
.product-description { white-space: pre-wrap; }
.summary-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.summary-row:last-child { border-bottom: 0; }
.summary-total { font-size: 20px; font-weight: 800; }
.payment-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 24px; }
.qr-box { background: #fff; border: 1px solid #d1d5db; border-radius: 12px; padding: 18px; text-align: center; }
.qr-box img, .qr-box canvas, .qr-box svg { max-width: 100%; height: auto; }
.qr-render { display: grid; place-items: center; min-height: 280px; }
.countdown { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field code { flex: 1; background: #f1f5f9; padding: 10px; border-radius: 7px; font-size: 17px; overflow-wrap: anywhere; }
.file-list { display: grid; gap: 10px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid #e5e7eb; border-radius: 8px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid #d1d5db; margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; border-bottom: 3px solid transparent; }
.tab.active { border-color: #111827; }
.asset-picker { border: 1px solid #d1d5db; border-radius: 8px; padding: 14px; }
.asset-list { display: grid; gap: 8px; margin-top: 10px; }
.asset-item { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 10px; align-items: center; border: 1px solid #e5e7eb; padding: 10px; border-radius: 7px; }
.folder-browser { border: 1px solid #d1d5db; border-radius: 8px; max-height: 420px; overflow: auto; }
.folder-entry { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
.folder-entry:last-child { border-bottom: 0; }
.folder-entry button { margin-left: auto; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 80; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 12px; padding: 22px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
pre.code { white-space: pre-wrap; overflow-wrap: anywhere; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 14px; }

.version-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.version-grid > div { background: var(--surface-soft); border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; }
.version-grid span { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.version-grid strong { display: block; margin-top: 4px; font-size: 18px; }
.system-info-card { margin-top: 18px; }
@media (max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-detail, .payment-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .container { width: min(100% - 20px, 1180px); }
  .header-row { align-items: flex-start; padding: 12px 0; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; }
  .user-menu { margin-left: auto; }
  .grid-2, .grid-3, .grid-4, .form-row, .version-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 24px; }
  .store-table thead { display: none; }
  .store-table, .store-table tbody, .store-table tr, .store-table td { display: block; width: 100%; }
  .store-table tr { border-bottom: 1px solid #cbd5e1; padding: 12px 0; }
  .store-table td { border: 0; padding: 5px 10px; }
  .store-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
  .file-row, .asset-item { grid-template-columns: 1fr; }
}
