:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 90% 0, #e5edff 0, transparent 32rem), #f4f6fb; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

.environment-bar { padding: 7px 20px; background: #7c2d12; color: #fff7ed; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-align: center; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px clamp(20px, 4vw, 56px); background: rgba(255,255,255,.9); border-bottom: 1px solid #dbe1ed; backdrop-filter: blur(18px); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(20px, 2.2vw, 29px); letter-spacing: -.03em; }
h2 { margin-bottom: 10px; font-size: 22px; }
h3 { margin-bottom: 12px; font-size: 16px; }
.eyebrow { margin-bottom: 5px; color: #52617c; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.muted { color: #647089; line-height: 1.7; }
.notice { padding: 12px 14px; border: 1px solid #d9e1f0; border-radius: 10px; background: #f8faff; color: #52617c; line-height: 1.6; }

main { padding: clamp(18px, 3vw, 38px); }
.center-card { width: min(520px, 100%); margin: clamp(40px, 8vh, 90px) auto; padding: clamp(28px, 5vw, 48px); border: 1px solid #dbe1ed; border-radius: 20px; background: #fff; box-shadow: 0 22px 70px rgba(37, 50, 82, .12); text-align: center; }
.danger-card { border-color: #fecaca; }
.icon-lock { display: inline-grid; width: 46px; height: 46px; place-items: center; margin-bottom: 18px; border-radius: 13px; background: #e8efff; color: #2456c4; }
.spinner { width: 32px; height: 32px; margin: 0 auto 16px; border: 3px solid #dbe4f8; border-top-color: #315fca; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.button { min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; transition: transform .12s ease, box-shadow .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: #2456c4; color: #fff; box-shadow: 0 8px 18px rgba(36, 86, 196, .2); }
.button-quiet { border-color: #cdd6e7; background: #fff; color: #34425d; }
.button-danger { background: #b42318; color: #fff; }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.account-area { display: flex; align-items: center; gap: 12px; }
.account-summary { max-width: 300px; color: #52617c; font-size: 12px; text-align: right; }

.admin-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px; max-width: 1480px; margin: 0 auto; }
.side-nav { display: flex; flex-direction: column; gap: 6px; align-self: start; position: sticky; top: 20px; padding: 10px; border: 1px solid #dbe1ed; border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(37,50,82,.07); }
.nav-button { padding: 12px 14px; border: 0; border-radius: 9px; background: transparent; color: #536078; font-weight: 800; text-align: left; }
.nav-button.active { background: #eaf0ff; color: #194aaa; }
.workspace { min-width: 0; }
.panel-stack { padding: clamp(18px, 3vw, 30px); border: 1px solid #dbe1ed; border-radius: 16px; background: #fff; box-shadow: 0 14px 42px rgba(37,50,82,.08); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin-bottom: 0; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-heading-actions { align-items: flex-end; flex-wrap: nowrap; }
.catalog-heading-actions .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; height: 42px; white-space: nowrap; }
.catalog-status-filter { flex: 0 0 150px; min-width: 150px; }
.catalog-status-filter select { height: 42px; }
.search-form { display: flex; align-items: end; gap: 12px; padding: 14px; border-radius: 12px; background: #f3f6fb; }
label { display: grid; gap: 6px; color: #3f4b63; font-size: 12px; font-weight: 800; }
.grow { flex: 1; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e5; border-radius: 8px; background: #fff; color: #172033; }
input, select { min-height: 40px; padding: 8px 11px; }
textarea { padding: 10px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(49,95,202,.17); border-color: #315fca; }
.inline-control { display: flex; align-items: end; gap: 8px; }
.result-area { margin-top: 22px; overflow-x: auto; }
.empty { padding: 32px; border: 1px dashed #cbd5e5; border-radius: 12px; color: #758097; text-align: center; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom: 1px solid #e4e9f2; vertical-align: top; text-align: left; }
.data-table th { color: #5d6880; font-size: 11px; letter-spacing: .04em; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 999px; background: #e8eef9; color: #34425d; font-size: 11px; font-weight: 900; }
.badge.active, .badge.paid { background: #dcfce7; color: #166534; }
.badge.suspended, .badge.expired, .badge.cancelled, .badge.revoked { background: #fee2e2; color: #991b1b; }
.detail-area { margin-top: 26px; padding-top: 24px; border-top: 2px solid #e1e7f0; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.detail-cell { padding: 12px; border: 1px solid #e0e6f0; border-radius: 10px; background: #fafbfe; }
.detail-cell dt { color: #6b7690; font-size: 11px; font-weight: 800; }
.detail-cell dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.action-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.section-block { margin-top: 22px; }
.catalog-subsection { padding-top: 24px; border-top: 2px solid #e1e7f0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 7px; padding: 8px; border: 1px solid #e0e6f0; border-radius: 8px; }
.checkbox-grid input { width: 17px; min-height: 17px; }
.offer-ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.offer-denied { border-color: #fecaca; background: #fff1f2; color: #9f1239; }
.flash { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #bae6fd; border-radius: 10px; background: #effaff; color: #075985; }
.global-flash { max-width: 1480px; margin-right: auto; margin-left: auto; }
.flash.error { border-color: #fecaca; background: #fff1f2; color: #9f1239; }
.confirm-dialog { width: min(560px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 28px 90px rgba(13,24,48,.3); }
.confirm-dialog::backdrop { background: rgba(15,23,42,.58); }
.confirm-dialog form { padding: 28px; }
.confirm-fields { display: grid; gap: 12px; margin: 18px 0; }
.confirm-fields.nested-fields { margin: 0; }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 16px; }
.check-row input { width: 18px; min-height: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.license-key-content { padding: 28px; }
.key-warning { padding: 13px 15px; border: 1px solid #f59e0b; border-radius: 10px; background: #fffbeb; color: #92400e; font-weight: 800; line-height: 1.65; }
.license-key-value { margin-top: 3px; padding: 12px 14px; border-color: #315fca; background: #f8faff; font-size: clamp(14px, 3vw, 19px); font-weight: 900; letter-spacing: .04em; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .account-area { flex-direction: column; align-items: flex-end; }
  .admin-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; }
  .nav-button { white-space: nowrap; }
  .search-form, .panel-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { flex-direction: column; }
  .catalog-heading-actions { align-items: stretch; }
  .catalog-status-filter { flex-basis: auto; min-width: 0; }
  .inline-control { align-items: stretch; flex-wrap: wrap; }
}
