/* ============================================================
   Growth Hype — Admin (white theme, bronze accents)
   Self-contained design system for login, dashboard, generator.
   ============================================================ */

:root {
  /* Bronze / tan brand ramp */
  --bronze-50:  #f7efe4;
  --bronze-100: #ecd9c1;
  --bronze-200: #dcbf9c;
  --bronze-300: #cba680;
  --bronze-400: #bb8f63;
  --bronze-500: #a9805a;   /* brand */
  --bronze-600: #8a6238;
  --bronze-700: #6b4a29;
  --gradient:   linear-gradient(135deg, #c9a582 0%, #a9805a 55%, #8a6238 100%);

  /* Light surfaces */
  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --surface-2:   #fafafa;
  --surface-3:   #f5f2ee;
  --border:      #e7e9ee;
  --border-2:    #d9dce2;
  --text:        #1b1712;
  --text-muted:  #6b6155;
  --text-dim:    #9a9186;

  --success:     #1f9d61;
  --success-bg:  #e7f6ee;
  --warn:        #b7791f;
  --warn-bg:     #fbf1dd;
  --danger:      #d9483b;
  --danger-bg:   #fbeae8;
  --info:        #2b6cb0;

  --radius:      16px;
  --radius-sm:   10px;
  --shadow-sm:   0 1px 2px rgba(24,18,10,.06), 0 1px 3px rgba(24,18,10,.04);
  --shadow:      0 12px 34px -14px rgba(24,18,10,.18);
  --shadow-lg:   0 30px 60px -24px rgba(24,18,10,.28);

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Urbanist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body.gh-admin {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

/* ---- Brand wordmark (works on light surfaces) ---- */
.gh-word {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
}
.gh-word .hype { color: var(--bronze-500); }
.gh-word .dot  { color: var(--bronze-500); }

/* Image logo (dark wordmark) for light surfaces */
.gh-logo { height: 24px; width: auto; display: block; }
.gh-login .brand .gh-logo { height: 34px; margin: 0 auto; }
.gh-sidebar .brand .gh-logo { height: 24px; }

/* ============================================================
   LOGIN
   ============================================================ */
.gh-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(169,128,90,.10), transparent 60%),
    var(--bg);
}
.gh-login {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 34px 30px;
}
.gh-login .brand { text-align: center; margin-bottom: 26px; }
.gh-login .brand .gh-word { font-size: 1.7rem; }
.gh-login h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 4px;
}
.gh-login .sub {
  text-align: center; color: var(--text-muted);
  font-size: .9rem; margin: 0 0 24px;
}

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.field .hint { font-size: .78rem; color: var(--text-dim); margin-top: 6px; }

.input, input[type=text], input[type=password], input[type=email],
input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input-icon { position: relative; }
.input-icon > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: .9rem;
}
.input-icon input { padding-left: 40px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--bronze-400);
  box-shadow: 0 0 0 3px rgba(169,128,90,.16);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 88px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-body);
  font-weight: 600; font-size: .92rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--bronze-500);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(138,98,56,.55);
}
.btn-primary:hover { background: var(--bronze-600); box-shadow: 0 12px 26px -8px rgba(138,98,56,.7); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--bronze-300); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #f7d9d5; }
.btn-sm { padding: 7px 12px; font-size: .82rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ============================================================
   ADMIN SHELL (sidebar + main)
   ============================================================ */
.gh-shell { display: flex; min-height: 100vh; }

.gh-sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.gh-sidebar .brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--border);
}
.gh-nav { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.gh-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600; font-size: .9rem;
  transition: background .15s, color .15s;
}
.gh-nav a i { width: 18px; text-align: center; font-size: .95rem; }
.gh-nav a:hover { background: var(--surface-3); color: var(--text); }
.gh-nav a.active {
  background: var(--bronze-50); color: var(--bronze-600);
}
.gh-nav a.active i { color: var(--bronze-500); }
.gh-nav .spacer { flex: 1; }
.gh-nav a.logout { color: var(--danger); }
.gh-nav a.logout:hover { background: var(--danger-bg); }

.gh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gh-topbar {
  height: 68px; flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 20;
}
.gh-topbar h1 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0; }
.gh-topbar .user {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; color: var(--text-muted);
}
.gh-topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.gh-content { padding: 28px; flex: 1; }

/* ============================================================
   CARDS / STATS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-head {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.card-head h2 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin: 0; }

.stat-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
}
.stat .ic {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--bronze-50); color: var(--bronze-600);
}
.stat .ic.green { background: var(--success-bg); color: var(--success); }
.stat .ic.amber { background: var(--warn-bg); color: var(--warn); }
.stat .ic.slate { background: #eef1f5; color: #48566a; }
.stat .val { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.table th {
  text-align: left; font-weight: 600; color: var(--text-dim);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
table.table td {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr { transition: background .12s; }
table.table tbody tr:hover { background: var(--surface-2); }
.pkg-name { font-weight: 700; color: var(--text); }
.pkg-desc { color: var(--text-muted); font-size: .82rem; margin-top: 2px; max-width: 320px; }
.amount { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active   { background: var(--success-bg); color: var(--success); }
.badge.inactive { background: #eef1f5; color: #48566a; }
.badge.expired  { background: var(--danger-bg); color: var(--danger); }
.badge.onetime  { background: var(--warn-bg); color: var(--warn); }
.badge.lifetime { background: var(--bronze-50); color: var(--bronze-600); }
.badge.plain::before { display: none; }

/* ============================================================
   COPY-LINK PILL / ACTIONS
   ============================================================ */
.link-pill {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 6px 5px 12px;
}
.link-pill code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .76rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border-2); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-muted); transition: all .13s; font-size: .82rem;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--bronze-300); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #f0c3bd; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 500; margin-bottom: 18px;
}
.alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c3bd; }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #b7e3cb; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(27,23,18,.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 480px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal .m-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal .m-head h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin: 0; }
.modal .m-body { padding: 24px; }
.modal .m-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal .close-x { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 1.1rem; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff;
  padding: 12px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 500;
  animation: toast-in .2s ease;
}
.toast.ok i { color: #6fe0a3; }
.toast.err i { color: #ff9b8f; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---- empty state ---- */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty i { font-size: 2.4rem; color: var(--bronze-200); margin-bottom: 14px; display: block; }
.empty h3 { font-family: var(--font-display); color: var(--text); margin: 0 0 6px; }

/* ---- radio cards (expiration select in generator) ---- */
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.radio-card {
  position: relative; cursor: pointer;
  border: 1.5px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; transition: all .14s;
}
.radio-card input { position: absolute; opacity: 0; }
.radio-card i { font-size: 1.1rem; color: var(--text-dim); }
.radio-card .t { font-weight: 700; font-size: .88rem; margin-top: 6px; }
.radio-card .d { font-size: .74rem; color: var(--text-muted); margin-top: 2px; }
.radio-card.selected { border-color: var(--bronze-400); background: var(--bronze-50); }
.radio-card.selected i, .radio-card.selected .t { color: var(--bronze-600); }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .gh-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); z-index: 60; transition: transform .2s; box-shadow: var(--shadow-lg); }
  .gh-sidebar.open { transform: none; }
  .gh-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; display: none; }
  .gh-backdrop.show { display: block; }
  .menu-btn { display: inline-grid !important; }
  .radio-cards { grid-template-columns: 1fr; }
}
.menu-btn { display: none; }
