@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ══ Reset ══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══ Variables ══════════════════════════════════ */
:root {
  --bg:            #1a0000;
  --card:          rgba(90,0,0,0.30);
  --border:        rgba(180,30,30,0.22);
  --border-focus:  rgba(220,50,50,0.55);
  --red:           #cc2222;
  --red-bright:    #e03333;
  --red-btn:       #d42020;
  --red-btn-h:     #e83030;
  --purple:        #7c3aed;
  --purple-h:      #6d28d9;
  --green-btn:     #16a34a;
  --green-btn-h:   #15803d;
  --text:          #ecdcdc;
  --muted:         #9a7575;
  --muted2:        #c0a0a0;
  --green:         #2fba72;
  --orange:        #e0823a;
  --input-bg:      rgba(60,0,0,0.45);
}

/* ══ Base ════════════════════════════════════════ */
html, body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
body { display: flex; flex-direction: column; position: relative; overflow-x: hidden; }

body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(180,0,0,0.28) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 82%, rgba(130,0,0,0.20) 0%, transparent 60%);
}

/* ══ Utility ═════════════════════════════════════ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 26px;
  backdrop-filter: blur(8px); transition: border-color 0.25s;
}
.card:hover { border-color: rgba(200,40,40,0.42); }

.btn {
  display: block; width: 100%; padding: 13px; border: none; border-radius: 8px;
  cursor: pointer; font-size: 15px; font-weight: 600; font-family: inherit;
  letter-spacing: 0.3px; transition: background 0.2s, transform 0.15s; text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-red    { background: var(--red-btn);  color: #fff; }
.btn-red:hover { background: var(--red-btn-h); }
.btn-purple { background: var(--purple);   color: #fff; }
.btn-purple:hover { background: var(--purple-h); }
.btn-green  { background: var(--green-btn); color: #fff; width: auto; padding: 11px 24px; }
.btn-green:hover { background: var(--green-btn-h); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════
   AUTH PAGE
══════════════════════════════════════════════════ */
#auth-page { display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }
.page-main  { flex: 1; display: flex; flex-direction: column; position: relative; }

.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 44px;
  background: rgba(20,0,0,0.55); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); position: relative; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-name { font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 18px; color: var(--red-bright); }

.create-account-btn {
  background: var(--red-btn); color: #fff; border: none;
  padding: 9px 20px; border-radius: 7px; font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: background 0.2s;
}
.create-account-btn:hover { background: var(--red-btn-h); }

.login-section {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; z-index: 5;
}

.login-card {
  background: rgba(70,0,0,0.38); border: 1px solid var(--border); border-radius: 16px;
  padding: 44px 42px 40px; width: 100%; max-width: 440px;
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center;
  animation: fadeUp 0.45s ease both;
}

.login-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(180,30,30,0.2); border: 1px solid rgba(200,50,50,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--red-bright); margin-bottom: 20px;
}

.card-title   { font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 6px; text-align: center; }
.card-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 30px; text-align: center; }

.field-group { width: 100%; margin-bottom: 14px; }
.field-label  { display: block; font-size: 13px; color: var(--muted2); margin-bottom: 6px; font-weight: 500; }

.input-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
}
.input-wrap:focus-within { border-color: var(--border-focus); }
.input-icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; display: flex; align-items: center; }
.input-wrap input {
  width: 100%; background: transparent; border: none; outline: none;
  padding: 12px 14px 12px 40px; color: var(--text); font-size: 14px; font-family: inherit;
}
.input-wrap input::placeholder { color: var(--muted); }

.eye-btn {
  position: absolute; right: 12px; background: none; border: none;
  cursor: pointer; color: var(--muted); display: flex; align-items: center; padding: 0;
}
.eye-btn:hover { color: var(--text); }

.forgot-link {
  display: block; text-align: left; width: 100%;
  font-size: 13px; color: var(--red-bright); text-decoration: none;
  margin: 14px 0 22px; transition: color 0.2s;
}
.forgot-link:hover { color: #f04444; }

.signin-btn {
  width: 100%; background: var(--red-btn); color: #fff; border: none;
  border-radius: 8px; padding: 13px; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: background 0.2s, transform 0.15s; margin-bottom: 22px;
}
.signin-btn:hover { background: var(--red-btn-h); }
.signin-btn:active { transform: scale(0.98); }
.no-account { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.create-link { font-size: 13px; color: var(--red-bright); text-decoration: none; }
.create-link:hover { color: #f04444; }

.footer-bar {
  position: relative; z-index: 5; background: rgba(10,0,0,0.7);
  border-top: 1px solid var(--border); padding: 7px 0 7px 52px;
  display: flex; align-items: center; gap: 0; height: 34px;
}
.footer-text { font-size: 13px; color: #7F737B; }

/* ══════════════════════════════════════════════════
   APP / DASHBOARD SHELL
══════════════════════════════════════════════════ */
#app-page { display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }

.dash-nav {
  display: flex; align-items: center; gap: 40px;
  padding: 0 40px; height: 64px;
  background: rgba(22,0,0,0.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: sticky; top: 0; z-index: 100;
}
.dash-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; background: var(--red); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 20px;
  color: #fff; letter-spacing: -1px; box-shadow: 0 0 18px rgba(200,0,0,0.5);
}
.logo-text { font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 18px; color: var(--red-bright); }

.dash-nav-links { display: flex; gap: 32px; list-style: none; flex: 1; }
.dash-nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.dash-nav-links a:hover,
.dash-nav-links a.active { color: var(--text); }

.dash-user-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.dash-user-email { font-size: 13px; color: var(--muted); }
.nav-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(100,0,0,0.3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s; color: var(--muted);
}
.nav-icon-btn:hover { background: rgba(140,0,0,0.45); color: var(--text); }

.dash-content {
  max-width: 1200px; width: 100%; margin: 0 auto; padding: 36px 28px; flex: 1;
}

.page-panel {
  background: rgba(70,0,0,0.18); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px 36px;
  backdrop-filter: blur(8px); animation: fadeUp 0.45s ease both;
}
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title  { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 600; color: var(--red-bright); }
.page-balance-display { font-size: 14px; color: var(--muted2); }
.page-balance-display span { color: var(--text); font-weight: 500; }

.section-title {
  font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 600;
  color: var(--text); letter-spacing: 0.8px; text-transform: uppercase;
}

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 24px; }
.stat-card { display: flex; align-items: center; justify-content: space-between; animation: fadeUp 0.45s ease both; }
.stat-card:nth-child(1){animation-delay:.05s} .stat-card:nth-child(2){animation-delay:.11s} .stat-card:nth-child(3){animation-delay:.17s}
.stat-label { font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.stat-value { font-family: 'Rajdhani', sans-serif; font-size: 34px; font-weight: 700; }
.stat-icon-circle { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-green  { background: rgba(47,186,114,0.12); color: var(--green); }
.icon-orange { background: rgba(224,130,58,0.12);  color: var(--orange); }
.icon-purple { background: rgba(155,107,212,0.12); color: #9b6bd4; }

/* FAQ */
.faq-panel { animation: fadeUp 0.45s 0.22s ease both; }
.faq-item { border-top: 1px solid var(--border); padding: 18px 0; }
.faq-item:first-of-type { border-top: none; padding-top: 0; }
.faq-item:last-of-type  { padding-bottom: 0; }
.faq-q { font-size: 15px; font-weight: 500; color: var(--red-bright); margin-bottom: 8px; }
.faq-a { font-size: 14px; color: var(--muted); line-height: 1.75; font-weight: 300; }

/* Store */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 20px; }
.store-card { display: flex; flex-direction: column; gap: 16px; }
.store-card-header { display: flex; align-items: flex-start; justify-content: space-between; }
.store-card-title  { font-family:'Rajdhani',sans-serif; font-size:19px; font-weight:700; color:var(--text); margin-bottom:3px; }
.store-card-type   { font-size:13px; color:var(--muted); }
.cart-icon { color: var(--red-bright); flex-shrink: 0; }

.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 36px 11px 14px;
  color: var(--text); font-size: 14px; font-family: inherit;
  appearance: none; cursor: pointer; outline: none; transition: border-color 0.2s;
}
.select-wrap select:focus { border-color: var(--border-focus); }
.select-wrap select option { background: #2a0000; color: var(--text); }
.select-wrap select option:disabled { color: var(--muted); }
.select-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }

/* Keys */
.keys-list { display: flex; flex-direction: column; }
.key-item {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  transition: background 0.2s; animation: fadeUp 0.4s ease both;
}
.key-item:last-child { border-bottom: none; }
.key-item:hover { background: rgba(120,0,0,0.12); }
.key-icon-wrap {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(180,30,30,0.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--red-bright);
}
.key-info   { flex: 1; min-width: 0; }
.key-product  { font-family:'Rajdhani',sans-serif; font-size:16px; font-weight:600; color:var(--text); margin-bottom:2px; }
.key-code     { font-size:13px; color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:2px; }
.key-duration { font-size:12px; color:var(--muted); }
.key-meta   { text-align:right; flex-shrink:0; }
.key-status { font-size:13px; font-weight:600; margin-bottom:4px; }
.status-expired { color: var(--red-bright); }
.status-active  { color: var(--green); }
.key-expires { font-size:12px; color:var(--muted); }

/* Balance */
.redeem-heading {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700;
  color: var(--text); margin-bottom: 18px;
}
.redeem-heading svg { color: var(--purple); }
.form-group-r { margin-bottom: 14px; }
.field-label-r { display: block; font-size: 13px; color: var(--muted2); margin-bottom: 6px; }
.form-input-plain {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s;
}
.form-input-plain:focus { border-color: var(--border-focus); }
.form-input-plain::placeholder { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { color: var(--red-bright); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(0,0,0,0.15); }
.data-table td { color: var(--muted2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(120,0,0,0.1); }

.status-badge { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.badge-pending  { background: rgba(234,130,58,0.18); color: #e07840; border: 1px solid rgba(234,130,58,0.3); }
.badge-approved { background: rgba(47,186,114,0.15); color: var(--green); border: 1px solid rgba(47,186,114,0.3); }
.badge-active   { background: rgba(47,186,114,0.15); color: var(--green); border: 1px solid rgba(47,186,114,0.3); }
.badge-expired  { background: rgba(220,34,34,0.15);  color: var(--red-bright); border: 1px solid var(--border); }

.approve-btn {
  background: rgba(47,186,114,0.15); color: var(--green);
  border: 1px solid rgba(47,186,114,0.3); border-radius: 6px;
  padding: 5px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.2s;
}
.approve-btn:hover { background: rgba(47,186,114,0.28); }

/* Admin */
.admin-gen-card { animation: fadeUp 0.45s ease both; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* Toast */
.toast {
  position: fixed; top: 20px; right: 20px;
  padding: 14px 20px; border-radius: 8px; color: #fff;
  font-weight: 600; font-family: inherit; font-size: 14px;
  z-index: 9999; max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); backdrop-filter: blur(8px);
  animation: fadeUp 0.3s ease;
}
.toast-success { background: rgba(22,163,74,0.92); border: 1px solid rgba(47,186,114,0.4); }
.toast-error   { background: rgba(185,28,28,0.92); border: 1px solid rgba(220,34,34,0.4); }

/* Responsive */
@media (max-width: 768px) {
  .stats-grid  { grid-template-columns: 1fr; }
  .store-grid  { grid-template-columns: 1fr; }
  .form-row-2  { grid-template-columns: 1fr; }
  .dash-nav    { padding: 0 18px; gap: 16px; }
  .dash-user-email { display: none; }
  .dash-content { padding: 24px 14px; }
  .page-panel  { padding: 22px 18px; }
  .top-nav     { padding: 14px 20px; }
}

/* ══════════════════════════════════════════════════
   OWNER DASHBOARD EXTRAS
══════════════════════════════════════════════════ */

/* Password cell */
.pw-cell { font-family: 'DM Mono', monospace; font-size: 13px; white-space: nowrap; }
.pw-mask  { color: var(--muted); letter-spacing: 2px; }
.pw-plain { color: var(--muted2); letter-spacing: 0.5px; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 0 0 0 6px; vertical-align: middle; display: inline-flex;
  align-items: center; transition: color 0.2s;
}
.icon-btn:hover { color: var(--text); }

/* Action group */
.action-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tbl-btn {
  padding: 5px 13px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; border: 1px solid transparent;
  transition: background 0.2s, opacity 0.2s; white-space: nowrap;
}
.btn-approve {
  background: rgba(47,186,114,0.14); color: var(--green);
  border-color: rgba(47,186,114,0.3);
}
.btn-approve:hover { background: rgba(47,186,114,0.26); }

.btn-edit {
  background: rgba(180,130,58,0.14); color: #e0a840;
  border-color: rgba(224,168,64,0.3);
}
.btn-edit:hover { background: rgba(224,168,64,0.24); }

.btn-ban {
  background: rgba(220,34,34,0.14); color: var(--red-bright);
  border-color: rgba(220,34,34,0.3);
}
.btn-ban:hover { background: rgba(220,34,34,0.26); }

.btn-unban {
  background: rgba(155,107,212,0.14); color: #b07de0;
  border-color: rgba(155,107,212,0.3);
}
.btn-unban:hover { background: rgba(155,107,212,0.26); }

/* Banned row */
.row-banned td { opacity: 0.55; }
.badge-banned {
  background: rgba(220,34,34,0.15); color: var(--red-bright);
  border: 1px solid rgba(220,34,34,0.35);
}

/* ══════════════════════════════════════════════════
   EDIT MODAL
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
  padding: 20px;
}
.modal-overlay.modal-visible { opacity: 1; }
.modal-overlay.modal-visible .modal-box { transform: translateY(0); }

.modal-box {
  background: #2a0000;
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: translateY(24px); transition: transform 0.25s;
  overflow: hidden;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700;
  color: var(--text); letter-spacing: 0.5px;
}
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; padding: 4px;
  border-radius: 6px; transition: color 0.2s, background 0.2s;
}
.modal-close:hover { color: var(--text); background: rgba(180,30,30,0.2); }

.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.btn-modal {
  padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none; transition: background 0.2s;
}
.btn-modal-cancel {
  background: rgba(180,30,30,0.15); color: var(--muted2);
  border: 1px solid var(--border);
}
.btn-modal-cancel:hover { background: rgba(180,30,30,0.28); color: var(--text); }
.btn-modal-save {
  background: var(--red-btn); color: #fff;
}
.btn-modal-save:hover { background: var(--red-btn-h); }

/* ══════════════════════════════════════════════════
   ADMIN — CODE REDEMPTION HISTORY
══════════════════════════════════════════════════ */
.code-mono { font-family: 'DM Mono', 'Courier New', monospace; letter-spacing: 1px; font-size: 13px; }

.code-main-row td { border-bottom: none; }

.redemption-header-row td {
  padding: 0 16px 12px !important;
  border-bottom: 1px solid var(--border);
}

.redemption-list {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(180,30,30,0.15);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 2px;
}

.redemption-list-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 10px;
}

.redemption-entry {
  display: flex; align-items: center; gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(180,30,30,0.12);
  font-size: 13px;
}
.redemption-entry:last-child { border-bottom: none; padding-bottom: 0; }

.redemption-user {
  display: flex; align-items: center; gap: 6px;
  color: var(--text); font-weight: 500; min-width: 120px;
}
.redemption-user svg { color: var(--red-bright); flex-shrink: 0; }

.redemption-amount {
  color: var(--green); font-weight: 600; font-family: 'Rajdhani', sans-serif;
  font-size: 14px; min-width: 60px;
}

.redemption-date { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ══════════════════════════════════════════════════
   KEY INVENTORY MANAGEMENT
══════════════════════════════════════════════════ */

/* Section card */
.ki-section {
  padding: 0;
  overflow: hidden;
  transition: border-color 0.25s;
}

/* Header */
.ki-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.ki-section-left { display: flex; align-items: center; gap: 10px; }
.ki-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.ki-section-title {
  font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.ki-price {
  font-size: 12px; color: var(--muted); background: rgba(180,30,30,0.15);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 8px;
}
.ki-stock-badge {
  font-size: 12px; font-weight: 700;
  border: 1px solid; border-radius: 20px;
  padding: 3px 12px; letter-spacing: 0.3px;
}

/* Keys list */
.ki-keys-list {
  padding: 6px 0;
  max-height: 220px; overflow-y: auto;
}
.ki-keys-list::-webkit-scrollbar { width: 4px; }
.ki-keys-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ki-key-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 22px;
  border-bottom: 1px solid rgba(180,30,30,0.1);
  transition: background 0.15s;
  gap: 12px;
}
.ki-key-row:last-child { border-bottom: none; }
.ki-key-row:hover { background: rgba(120,0,0,0.12); }

.ki-key-code {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 13px; color: var(--muted2); letter-spacing: 0.8px;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ki-del-btn { flex-shrink: 0; font-size: 11px; }

.ki-empty {
  padding: 16px 22px;
  font-size: 13px; color: var(--muted);
  font-style: italic;
}

/* Add single key row */
.ki-add-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}
.ki-add-input { flex: 1; margin-bottom: 0; font-family: 'DM Mono', monospace; font-size: 13px; }
.ki-add-btn { flex-shrink: 0; width: auto; display: flex; align-items: center; gap: 6px; }

/* Bulk add row */
.ki-bulk-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0 22px 16px;
  background: rgba(0,0,0,0.1);
}
.ki-bulk-input {
  flex: 1; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; color: var(--text);
  font-size: 12px; font-family: 'DM Mono', monospace;
  resize: vertical; outline: none; transition: border-color 0.2s;
  line-height: 1.6;
}
.ki-bulk-input:focus { border-color: var(--border-focus); }
.ki-bulk-input::placeholder { color: var(--muted); }
.ki-bulk-btn { flex-shrink: 0; width: auto; margin-top: 2px; display: flex; align-items: center; gap: 6px; }

/* ══════════════════════════════════════════════════
   KEY ACTIONS DROPDOWN (customer keys page)
══════════════════════════════════════════════════ */
.key-item { flex-wrap: wrap; align-items: flex-start; }

.key-actions { margin-top: 8px; }
.key-action-select {
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 30px 6px 10px;
  color: var(--muted2); font-size: 12px; font-family: inherit;
  appearance: none; cursor: pointer; outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239a7575' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.key-action-select:focus { border-color: var(--border-focus); }
.key-action-select option { background: #2a0000; color: var(--text); }

/* Key request log */
.key-log { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.key-log-entry {
  font-size: 12px; padding: 5px 10px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.key-log-entry.completed {
  background: rgba(47,186,114,0.08); border: 1px solid rgba(47,186,114,0.2);
  color: var(--green);
}
.key-log-entry.pending {
  background: rgba(224,130,58,0.08); border: 1px solid rgba(224,130,58,0.2);
  color: var(--orange);
}
.log-note { font-size: 11px; color: var(--muted2); padding-left: 4px; }

/* ══════════════════════════════════════════════════
   REQUESTS PAGE (admin/owner)
══════════════════════════════════════════════════ */
#requestsBody { display: flex; flex-direction: column; gap: 14px; }

.req-empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

.req-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.25s;
  animation: fadeUp 0.35s ease both;
}
.req-card:hover { border-color: rgba(200,40,40,0.4); }
.req-complete {
  opacity: 0.55;
  filter: grayscale(0.3);
}
.req-complete:hover { opacity: 0.75; }

/* Card header */
.req-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.req-type-badge {
  font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700;
  border: 1px solid; border-radius: 6px; padding: 3px 12px;
  letter-spacing: 0.4px;
}
.req-meta-right { display: flex; align-items: center; gap: 10px; }
.req-status-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.req-pending { background: rgba(224,130,58,0.15); color: var(--orange); border: 1px solid rgba(224,130,58,0.3); }
.req-done    { background: rgba(47,186,114,0.12); color: var(--green);  border: 1px solid rgba(47,186,114,0.3); }

/* Card body rows */
.req-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; }
.req-row  { display: flex; align-items: flex-start; gap: 14px; font-size: 13px; }
.req-label { color: var(--muted); min-width: 74px; flex-shrink: 0; font-weight: 500; }
.req-val   { color: var(--muted2); flex: 1; }
.req-username { display: flex; align-items: center; gap: 5px; color: var(--text); font-weight: 500; }
.req-username svg { color: var(--red-bright); flex-shrink: 0; }
.req-keycode { font-family: 'DM Mono', monospace; font-size: 12px; letter-spacing: 0.8px; color: var(--text); }
.req-duration {
  font-size: 11px; background: rgba(180,30,30,0.15); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 7px; color: var(--muted); margin-left: 4px;
}
.req-note { color: var(--muted2); font-style: italic; }

/* Card actions */
.req-actions {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
  display: flex; flex-direction: column; gap: 10px;
}
.req-note-input { font-size: 13px; }
.req-btn-row { display: flex; gap: 10px; }

/* ══════════════════════════════════════════════════
   APP TAGS & CHECKBOXES
══════════════════════════════════════════════════ */
.apps-cell { display:flex; flex-wrap:wrap; gap:5px; max-width:200px; }
.app-tag {
  font-size:11px; font-weight:600; padding:2px 9px; border-radius:20px;
  background:rgba(180,30,30,0.2); border:1px solid rgba(180,30,30,0.35);
  color:var(--muted2); white-space:nowrap;
}
.app-checkboxes {
  display:flex; flex-direction:column; gap:8px;
  max-height:180px; overflow-y:auto; padding:4px 0;
}
.app-checkbox-label {
  display:flex; align-items:center; gap:10px; cursor:pointer;
  font-size:13px; color:var(--muted2); transition:color 0.15s;
  padding:5px 8px; border-radius:6px;
}
.app-checkbox-label:hover { background:rgba(120,0,0,0.2); color:var(--text); }
.app-checkbox {
  width:15px; height:15px; accent-color:var(--red-bright); cursor:pointer; flex-shrink:0;
}

/* ══════════════════════════════════════════════════
   KEY INVENTORY — product card layout
══════════════════════════════════════════════════ */
.ki-product-card { padding:0; overflow:hidden; }
.ki-product-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 22px; background:rgba(0,0,0,0.2);
  border-bottom:1px solid var(--border);
}
.ki-product-name {
  display:flex; align-items:center; gap:8px;
  font-family:'Rajdhani',sans-serif; font-size:18px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.5px;
}
.ki-product-total {
  font-size:12px; color:var(--muted); background:rgba(180,30,30,0.12);
  border:1px solid var(--border); border-radius:4px; padding:2px 10px;
}
.ki-product-body { display:flex; flex-direction:column; }

/* Duration block within a product */
.ki-dur-block { border-bottom:1px solid var(--border); }
.ki-dur-block:last-child { border-bottom:none; }
.ki-dur-header {
  display:flex; align-items:center; gap:10px;
  padding:12px 22px 8px; background:rgba(0,0,0,0.08);
}
.ki-dur-label { font-family:'Rajdhani',sans-serif; font-size:15px; font-weight:700; text-transform:uppercase; }

/* Reuse existing ki-* styles for rows, inputs etc */

/* ══════════════════════════════════════════════════
   REBRAND BUILDER
══════════════════════════════════════════════════ */
.rb-create-card { padding:24px; }
.rb-create-row  { display:flex; align-items:center; gap:12px; }
.section-title  { font-family:'Rajdhani',sans-serif; font-size:17px; font-weight:700; color:var(--red-bright); text-transform:uppercase; letter-spacing:0.5px; }

/* ══════════════════════════════════════════════════
   NAV — user chip + discord tag + logout icon
══════════════════════════════════════════════════ */
.nav-user-chip {
  display: flex; align-items: center; gap: 7px;
  background: rgba(120,0,0,0.25); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 13px 5px 10px;
  font-size: 13px; color: var(--muted2); font-weight: 500;
  max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.nav-user-chip svg { color: var(--red-bright); flex-shrink: 0; }
.nav-discord-tag {
  font-size: 11px; color: #5865F2; background: rgba(88,101,242,0.12);
  border: 1px solid rgba(88,101,242,0.3); border-radius: 20px;
  padding: 4px 10px; font-weight: 600; white-space: nowrap;
  display: none;
}
.nav-discord-tag:not(:empty) { display: block; }

/* ══════════════════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════════════════ */
.settings-card { padding: 0; overflow: hidden; }
.settings-card-header {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
}
.settings-card-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.settings-card-title {
  font-family: 'Rajdhani', sans-serif; font-size: 15px;
  font-weight: 700; color: var(--text); margin-bottom: 3px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.settings-card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.settings-discord-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; border-top: 1px solid var(--border);
  font-size: 13px;
}
.settings-discord-user { font-weight: 600; color: var(--text); min-width: 100px; }
.settings-discord-tag  { color: #5865F2; font-size: 12px; flex: 1; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(120,0,0,0.3); border: 1px solid var(--border);
  border-radius: 34px; transition: 0.25s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: var(--muted);
  border-radius: 50%; transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(47,186,114,0.25); border-color: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); background: var(--green); }

/* ══════════════════════════════════════════════════
   DISCORD GATE OVERLAY
══════════════════════════════════════════════════ */
.discord-gate-card {
  background: var(--card);
  border: 1px solid rgba(88,101,242,0.3);
  border-radius: 20px;
  padding: 44px 44px 36px;
  max-width: 460px;
  width: 92%;
  text-align: center;
  box-shadow: 0 0 80px rgba(88,101,242,0.12), 0 0 0 1px rgba(88,101,242,0.08);
}
.discord-gate-logo {
  width: 72px; height: 72px;
  background: rgba(88,101,242,0.12);
  border: 2px solid rgba(88,101,242,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}
.discord-gate-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.discord-gate-sub {
  font-size: 14px; color: var(--muted);
  line-height: 1.7; margin-bottom: 22px;
}
.discord-locked-notice {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(180,30,30,0.12);
  border: 1px solid rgba(180,30,30,0.25);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px; color: var(--muted2);
  margin-bottom: 26px;
}
.discord-oauth-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #5865F2;
  color: #fff;
  border: none; border-radius: 10px;
  padding: 13px 32px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.2px;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  box-shadow: 0 4px 20px rgba(88,101,242,0.35);
}
.discord-oauth-btn:hover  { background: #4752c4; box-shadow: 0 6px 28px rgba(88,101,242,0.5); }
.discord-oauth-btn:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════════
   LOCKED NAV ITEMS (Discord not verified)
══════════════════════════════════════════════════ */
.dash-nav-links a.nav-locked {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;  /* keep clickable so we can intercept + show gate */
  position: relative;
}
.dash-nav-links a.nav-locked::after {
  content: '🔒';
  font-size: 9px;
  position: absolute;
  top: -3px; right: -2px;
  opacity: 0.7;
}
