:root {
  --bg: #eef7ff;
  --panel: #ffffff;
  --line: #d6e8f7;
  --text: #18324a;
  --muted: #5f7f99;
  --accent: #3eb2fc;
  --accent-strong: #1d9bf0;
  --ok: #1e8850;
  --ok-bg: #eaf8f0;
  --error: #b33131;
  --error-bg: #fdecec;
  --sidebar: #173a5c;
  --sidebar-2: #1f4a74;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
}

.front-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 100% -5%, #c7ecff 0%, rgba(199, 236, 255, 0) 70%),
    radial-gradient(700px 400px at -10% -10%, #d8f1ff 0%, rgba(216, 241, 255, 0) 70%),
    #f2f9ff;
}

.front-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  border: 1px solid #a9dcfb;
  box-shadow: 0 6px 20px rgba(62, 178, 252, 0.25);
}

.app-name {
  color: #2382bd;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.app-brand h1 {
  margin: 0;
  font-size: 30px;
}

.admin-link {
  color: #0f679d;
  border: 1px solid #9ad6fa;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e9f7ff;
  text-decoration: none;
}

.hero-ribbon {
  background: linear-gradient(130deg, #f8fdff 0%, #e8f6ff 100%);
  border: 1px solid #c5e8fb;
  border-radius: 16px;
  padding: 18px 20px;
}

.hero-subtitle {
  margin: 10px 0 8px;
  color: var(--muted);
}

.promo-badge {
  display: inline-block;
  background: #d9f1ff;
  color: #0f699f;
  border: 1px solid #a6dbfb;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.promo-note {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #8dd3fc;
  color: #0f679d;
  font-weight: 600;
}

.deadline-text {
  margin-top: 10px;
  color: #2f7cab;
  font-size: 13px;
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 18px 0;
}

.card,
.panel,
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.membership-card {
  background: linear-gradient(170deg, #ffffff 0%, #f3fbff 100%);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.plan-promo {
  margin: 10px 0;
  color: #147cb8;
  font-weight: 600;
}

.stock {
  color: #4d7697;
  font-size: 13px;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

button {
  margin-top: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  background: #9fb5c4;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.ghost.full {
  width: 100%;
}

button.danger,
.btn-mini.danger {
  background: #d12f2f;
  color: #fff;
}

button.danger:hover,
.btn-mini.danger:hover {
  background: #b92828;
}

a {
  color: #1688cd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  word-break: break-all;
}

thead th {
  background: #f3faff;
}

.flash-wrap {
  margin: 12px 0;
}

.flash {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 8px;
}

.flash-success {
  color: var(--ok);
  border-color: #99d6b4;
  background: var(--ok-bg);
}

.flash-error {
  color: var(--error);
  border-color: #f0b4b4;
  background: var(--error-bg);
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: 16px 0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.btn-box button {
  margin-top: 0;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.kpi-title {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
}

.tag.used {
  background: #ffeaea;
  color: #bd2e2e;
}

.tag.unused {
  background: #e9f7ef;
  color: #237f50;
}

.tag.expired {
  background: #fff1df;
  color: #a16617;
}

.tag.hot {
  background: #d9f1ff;
  color: #0f699f;
  border: 1px solid #9cd8fc;
}

.inline-form {
  display: inline;
}

.row-check,
#checkAll {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-cell {
  width: 48px;
  text-align: center;
}

.btn-mini {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  color: #2a5f84;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  margin-right: 4px;
  cursor: pointer;
}

.page-head {
  margin-bottom: 10px;
}

.desc {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

.plan-config-card {
  margin-top: 12px;
  border: 1px dashed #a8dbfa;
  border-radius: 10px;
  padding: 12px;
  background: #f5fbff;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.check-line input {
  width: auto;
}

.link-back {
  display: inline-block;
  margin-top: 12px;
}

.narrow-content {
  max-width: 760px;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eff8ff;
}

.login-box {
  width: 100%;
  max-width: 460px;
}

.admin-body {
  background: #eef4fa;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.admin-sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #d3e7f5;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
  padding: 8px 10px;
}

.admin-nav {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.nav-item {
  color: #c4dff4;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.admin-main {
  padding: 20px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-actions .ghost,
.toolbar-actions .danger,
.toolbar-actions .btn-mini {
  width: auto;
  margin-top: 0;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pager-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    height: auto;
    position: relative;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-brand h1 {
    font-size: 24px;
  }
}
