
:root {
  --green: #102747;
  --green2: #193b62;
  --mint: #edf1f6;
  --paper: #f5f6f8;
  --ink: #172b45;
  --muted: #7c8796;
  --line: #e5e8ee;
  --white: #fff;
  --gold: #c9a75e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Cairo', sans-serif;
}

.topbar {
  min-height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(18px, calc((100% - 760px)/2));
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 3px 14px #10274708;
}

.brand { display:flex; align-items:center; gap:12px; }
.brand b { display:block; font-size:18px; color:var(--green); }
.brand small { display:block; color:var(--muted); font-size:10px; }

.brand-mark {
  display:grid;
  place-items:center;
  width:43px;
  height:43px;
  border-radius:14px;
  background:var(--green);
  color:var(--gold);
  font-weight:800;
  font-size:23px;
  border:1px solid #c9a75e80;
}

.icon-btn {
  border:1px solid var(--line);
  background:var(--mint);
  border-radius:12px;
  width:42px;
  height:42px;
  font-size:25px;
  color:var(--green);
  cursor:pointer;
}

.wrap {
  width:min(100% - 26px,700px);
  margin:22px auto 45px;
}

.hero {
  background:
    radial-gradient(circle at 5% 0%,#31577f 0,transparent 42%),
    linear-gradient(145deg,#102747,#0b1d35);
  border:1px solid #c9a75e55;
  border-radius:25px;
  color:#fff;
  padding:25px 22px 20px;
  box-shadow:0 15px 35px #10274720;
  position:relative;
  overflow:hidden;
}

.hero:after {
  content:'۞';
  position:absolute;
  font-size:190px;
  opacity:.055;
  color:var(--gold);
  left:-20px;
  bottom:-85px;
  pointer-events:none;
}

.hero-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.eyebrow { font-size:11px; color:#e2d1a6; }
.live-dot { font-size:10px; color:#d8c18a; }

.hero h1 {
  font-size:32px;
  line-height:1.5;
  margin:15px 0 6px;
  font-weight:800;
}

.hero h1 span { color:#e4cc91; }

.hero p {
  font-size:12px;
  color:#d4deeb;
  line-height:2;
  margin:0 0 20px;
  max-width:430px;
}

.stats {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}

.stats div {
  background:#ffffff12;
  border:1px solid #ffffff20;
  border-radius:14px;
  padding:11px 6px;
  text-align:center;
  backdrop-filter:blur(5px);
}

.stats strong {
  display:block;
  font-size:21px;
  font-weight:800;
  color:#f0d69a;
}

.stats span {
  display:block;
  font-size:9px;
  color:#e0e6ee;
}

.tabs {
  display:flex;
  background:#e9edf3;
  padding:4px;
  border-radius:15px;
  margin:17px 0 13px;
}

.tab {
  flex:1;
  border:0;
  background:transparent;
  border-radius:11px;
  padding:12px;
  font:700 13px Cairo;
  color:#63738a;
  cursor:pointer;
}

.tab.active {
  background:#fff;
  color:var(--green);
  box-shadow:0 2px 9px #10274712;
}

.panel {
  background:#fff;
  border:1px solid var(--line);
  border-radius:21px;
  padding:18px 15px;
  margin-bottom:16px;
  box-shadow:0 5px 20px #10274708;
}

.section-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:15px;
}

.section-head h2 {
  font-size:17px;
  margin:0 0 3px;
  color:var(--green);
}

.section-head p {
  font-size:10px;
  color:var(--muted);
  margin:0;
  line-height:1.9;
}

.soft-btn {
  border:1px solid #e4e8ee;
  background:#f8f9fb;
  border-radius:11px;
  padding:9px 11px;
  font:600 10px Cairo;
  color:#52647b;
  white-space:nowrap;
  cursor:pointer;
}

.toolbar { display:flex; gap:8px; margin:13px 0; }
.toolbar input { flex:1; min-width:0; }
.toolbar select { width:104px; }

input, select, textarea {
  font:12px Cairo;
  color:var(--ink);
  border:1px solid #dfe5ed;
  border-radius:12px;
  background:#fbfcfe;
  padding:11px;
  outline:none;
}

input:focus, select:focus, textarea:focus {
  border-color:var(--gold);
  box-shadow:0 0 0 3px #c9a75e20;
}

.codes-list { display:grid; gap:10px; }

.code-card {
  border:1px solid #e6eaf0;
  border-radius:16px;
  padding:12px;
  background:#fff;
  transition:box-shadow .2s,border-color .2s;
}

.code-card:hover {
  border-color:#c9a75e;
  box-shadow:0 5px 15px #1027470c;
}

.code-card.pinned {
  border-color:var(--gold);
  background:linear-gradient(120deg,#fffdf7,#fff);
}

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

.code-label { font-size:10px; color:#8490a0; }

.code-value {
  font-family:ui-monospace,monospace;
  font-weight:800;
  letter-spacing:.5px;
  font-size:17px;
  direction:ltr;
  text-align:right;
  color:var(--green);
}

.pin-badge {
  font-size:9px;
  color:#806326;
  background:#f6edda;
  border-radius:20px;
  padding:4px 9px;
}

.actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.primary-btn, .open-btn, .copy-btn {
  border:0;
  border-radius:11px;
  padding:11px 8px;
  font:700 11px Cairo;
  cursor:pointer;
  transition:opacity .2s,transform .2s;
}

.primary-btn:hover, .open-btn:hover, .copy-btn:hover {
  opacity:.88;
  transform:translateY(-1px);
}

.open-btn, .primary-btn {
  background:var(--green);
  color:white;
}

.copy-btn {
  background:#f0f2f6;
  color:var(--green);
  border:1px solid #e4e8ef;
}

.loading, .empty {
  padding:30px 10px;
  text-align:center;
  color:#8290a0;
  font-size:12px;
}

.more-btn {
  display:block;
  margin:13px auto 0;
  background:#f1f3f7;
  border:1px solid var(--line);
  border-radius:11px;
  padding:10px 25px;
  font:700 11px Cairo;
  color:var(--green);
  cursor:pointer;
}

.notice, .privacy-note {
  font-size:10px;
  line-height:1.9;
  color:#718096;
  background:#f5f7fa;
  border:1px solid #edf0f4;
  border-radius:12px;
  padding:11px 12px;
  margin-top:14px;
}

textarea {
  width:100%;
  resize:vertical;
  line-height:1.8;
  direction:ltr;
  text-align:left;
  font-family:ui-monospace,monospace;
  font-size:13px;
}

.input-hint {
  font-size:10px;
  color:var(--muted);
  margin:7px 2px 13px;
}

.primary-btn {
  width:100%;
  font-size:13px;
  padding:13px;
}

.result { font-size:11px; line-height:1.8; margin-top:10px; }
.result.success { color:#176b47; }
.result.error { color:#b34435; }

.admin-panel input { width:100%; margin:5px 0; }

.admin-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  margin-bottom:12px;
}

.admin-code {
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--line);
  padding:10px 0;
  gap:8px;
  font:700 12px ui-monospace;
}

.delete-btn {
  border:0;
  background:#fff0ee;
  color:#a33b31;
  border-radius:8px;
  padding:7px 10px;
  font:600 10px Cairo;
  cursor:pointer;
}

footer {
  text-align:center;
  color:#8490a0;
  font-size:10px;
  line-height:1.9;
  padding:10px 15px;
}

footer small {
  display:block;
  max-width:440px;
  margin:4px auto;
}

.admin-link {
  border:0;
  background:none;
  color:#718096;
  text-decoration:underline;
  font:10px Cairo;
  margin-top:8px;
  cursor:pointer;
}

.toast {
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translate(-50%,20px);
  opacity:0;
  pointer-events:none;
  background:#102747;
  color:#fff;
  padding:11px 18px;
  border-radius:30px;
  font:12px Cairo;
  z-index:10;
  transition:.2s;
  white-space:nowrap;
  border:1px solid #c9a75e;
}

.toast.show { opacity:1; transform:translate(-50%,0); }

[hidden] { display:none!important; }

@media(min-width:600px) {
  .wrap { margin-top:28px; }
  .hero { padding:29px 28px 23px; }
  .hero h1 { font-size:36px; }
  .panel { padding:21px; }
  .code-card { padding:14px 16px; }
}

@media(max-width:380px) {
  .hero h1 { font-size:27px; }
  .stats { gap:5px; }
  .stats div { padding:9px 3px; }
  .stats strong { font-size:18px; }
  .stats span { font-size:8px; }
}
