:root {
  --bg: #f3f7fb;
  --fg: #11203a;
  --card: #ffffff;
  --line: #d6dfeb;
  --primary: #0f5bd7;
  --ok: #1f9d58;
  --warn: #c78d18;
  --danger: #bf2f45;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--fg); }
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.topbar { background: #0d1b32; color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.2rem; }
.row { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap { gap: .75rem; }
.hero { background: linear-gradient(120deg, #0f5bd7, #0b8bd2); color: #fff; padding: 2rem; border-radius: 14px; margin: 1rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.price { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.metric { font-size: 1.4rem; font-weight: 700; }
.btn { border: 0; background: var(--primary); color: #fff; border-radius: 8px; padding: .55rem .8rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.alt { background: #324664; }
.btn.small { padding: .35rem .55rem; font-size: .85rem; }
.btn.ok { background: var(--ok); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.form { display: flex; flex-direction: column; gap: .75rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .93rem; }
input, select, textarea { padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { resize: vertical; min-height: 100px; }
.wide { grid-column: 1 / -1; }
.checkline { display: flex; flex-direction: row; align-items: center; gap: .5rem; }
.alerts { margin-top: .5rem; }
.alert { border-radius: 8px; padding: .6rem .75rem; margin-bottom: .5rem; }
.alert.error { background: #fee2e7; color: #8f1630; }
.alert.ok { background: #dcfce7; color: #155e37; }
.auth-card { max-width: 420px; margin: 2rem auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: .45rem; text-align: left; vertical-align: top; }
.inline { display: inline-flex; align-items: center; gap: .4rem; margin: .2rem .25rem .2rem 0; }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tiny-btn { width: 30px; height: 30px; }
.tiny-btn svg { width: 15px; height: 15px; }
.renew-badge { display: inline-block; margin-top: .2rem; padding: .2rem .45rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #e7f0ff; color: #1346a2; }
.modal-dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(560px, 92vw); }
.modal-dialog::backdrop { background: rgba(13, 27, 50, .45); }
.modal-head { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-dialog .form { padding: 1rem; }
.modal-form-pad { padding: 1rem; }
.modal-note { margin: 0 0 .5rem 0; color: #324664; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.package-card { margin: 0; }
.pkg-status { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .25rem .55rem; color: #fff; background: var(--danger); }
.pkg-status.ok { background: var(--ok); }
.feature-box { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.feature-box legend { padding: 0 .35rem; font-weight: 700; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .6rem; }
.feature-choice { display: grid; grid-template-columns: 18px 1fr; column-gap: .55rem; row-gap: .15rem; align-items: start; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.feature-choice input { margin-top: .2rem; }
.feature-title { font-weight: 700; line-height: 1.1; }
.feature-desc { grid-column: 2; font-size: .9rem; line-height: 1.25; color: #4c5f80; }
.feature-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.feature-admin-card { margin: 0; }
.feature-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; padding: .2rem .45rem; border-radius: 999px; border: 1px solid var(--line); background: #f7f9fc; }
.feature-usage { margin: 0; color: #425776; font-size: .9rem; }
.users-full-width { width: calc(100vw - 2rem); margin-left: calc(50% - 50vw + 1rem); margin-right: calc(50% - 50vw + 1rem); }
.full-bleed { width: calc(100vw - 2rem); margin-left: calc(50% - 50vw + 1rem); margin-right: calc(50% - 50vw + 1rem); }
.stats-iframe { width: 100%; min-height: 82vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.url-row { width: 100%; align-items: center; }
.url-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem;
}
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chart-box { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: .7rem; }
.chart-box h3 { margin: 0 0 .5rem 0; }
.usage-chart { width: 100%; height: 220px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fbff; }
.menu-dropdown { position: relative; }
.menu-dropdown summary { list-style: none; }
.menu-dropdown summary::-webkit-details-marker { display: none; }
.menu-dropdown[open] .menu-dropdown-panel { display: flex; }
.menu-dropdown-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 20;
  min-width: 220px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  padding: .35rem;
}
.menu-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  padding: .5rem .55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .92rem;
}
.menu-item:hover { background: #eef4ff; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } .table { display: block; overflow-x: auto; } }
