/* ==========================================================================
   HALF ROLEPLAY — Monochrome Purple / Black
   هادئ · أنيق · مريح للعين · لونان فقط (بنفسجي + أسود)
   RTL · Arabic — Fully responsive
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Base — أسود عميق متدرج */
  --bg: #0a0a0e;
  --bg-2: #0f0f16;
  --bg-3: #14141d;

  /* Surfaces */
  --paper: rgba(255, 255, 255, 0.028);
  --paper-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.07);
  --line-bright: rgba(255, 255, 255, 0.12);

  /* Ink — رمادي فاتح مريح */
  --ink: #e9e9f0;
  --ink-2: #b9bac7;
  --ink-dim: #7d7e92;

  /* Accent — بنفسجي فقط (درجات الموف) */
  --brand: #8b5cf6;      /* بنفسجي أساسي */
  --brand-2: #a78bfa;    /* موف فاتح */
  --brand-deep: #6d28d9; /* بنفسجي داكن */
  --brand-glow: rgba(139, 92, 246, 0.35);

  /* ألوان وظيفية (بأقل بريق) */
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;

  /* Fonts */
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-head: 'Changa', 'Cairo', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 12px 40px rgba(139, 92, 246, 0.15);

  --grad: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(139, 92, 246, 0.10), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; }
a { color: var(--brand-2); text-decoration: none; transition: color .2s; }
a:hover { color: #c4b5fd; }
code { font-family: var(--font-mono); }

::selection { background: rgba(139, 92, 246, 0.30); color: #fff; }

/* Scrollbar — بنفسجي هادئ */
::-webkit-scrollbar { width: 11px; background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #2a2a38; border-radius: 20px; border: 3px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: #6d28d9; }

/* ---------- Container ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* Fade-in للنص بعد الـ hero */
main > * { animation: fadeIn .6s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.topbar {
  position: relative;
  z-index: 60;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding-top: 9px; padding-bottom: 9px; flex-wrap: wrap;
}
.ip-copy {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line-bright);
  padding: 7px 16px; border-radius: 999px;
  cursor: pointer; transition: .25s;
}
.ip-copy:hover { border-color: var(--brand); color: #fff; }
.ip-copy .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-dim); }
.ip-copy.online .dot { background: var(--ok); box-shadow: 0 0 8px rgba(74,222,128,.7); }
.ip-copy .copy-ico { opacity: .7; }
.topbar .links { display: flex; gap: 18px; }
.topbar .links a { color: var(--ink-dim); font-size: 13px; }
.topbar .links a:hover { color: var(--brand-2); }

/* ==========================================================================
   SITE HEADER (sticky)
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 14, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled { background: rgba(10, 10, 14, 0.92); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }

.brand { display: flex; align-items: center; gap: 13px; }
.brand .logo { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; filter: drop-shadow(0 0 8px rgba(139,92,246,.35)); }
.brand .name { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: 1px; color: #fff; }
.brand .name b { color: var(--brand-2); letter-spacing: 2px; }
.brand .tagline { font-size: 11.5px; color: var(--ink-dim); margin-top: 4px; letter-spacing: .5px; }

.main-nav { display: flex; gap: 2px; align-items: center; }
.main-nav a {
  padding: 9px 15px; border-radius: 9px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 600; transition: .2s;
}
.main-nav a:hover { color: #fff; background: var(--paper-2); }
.main-nav a.active { color: #fff; background: rgba(139, 92, 246, 0.14); box-shadow: inset 0 0 0 1px rgba(139,92,246,.35); }

.auth-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: var(--paper-2); border: 1px solid var(--line-bright);
  border-radius: 9px; padding: 10px; cursor: pointer;
}
.nav-toggle span { width: 21px; height: 2px; background: #fff; border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   BUTTONS — بنفسجي أحادي
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: var(--font); font-weight: 600;
  font-size: 14px; padding: 11px 22px; border-radius: 11px;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--line-bright);
  transition: transform .18s, background .3s, color .3s, border-color .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 10px 26px rgba(109,40,217,.28); }
.btn-primary:hover { background: linear-gradient(135deg,#7c3aed,#a78bfa); color: #fff; box-shadow: 0 14px 34px rgba(109,40,217,.4); }
.btn-gold {
  background: var(--grad); color: #fff; border: none;
  box-shadow: 0 10px 26px rgba(109,40,217,.28);
}
.btn-gold:hover { color: #fff; background: linear-gradient(135deg,#7c3aed,#a78bfa); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: #fff; }
.btn-danger { background: rgba(248,113,113,.12); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.22); color: #fca5a5; }
.btn-ok { background: rgba(74,222,128,.12); color: var(--ok); border: 1px solid rgba(74,222,128,.3); }
.btn-ok:hover { color: #86efac; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ==========================================================================
   ALERTS
   ========================================================================== */
.alert {
  border: 1px solid var(--line-bright); border-radius: var(--radius-sm);
  padding: 13px 17px; margin-bottom: 16px; font-size: 14px;
  background: var(--paper-2); border-right-width: 4px;
}
.alert-error { border-right-color: var(--danger); background: rgba(248,113,113,.06); color: #fecaca; }
.alert-success { border-right-color: var(--ok); background: rgba(74,222,128,.06); color: #bbf7d0; }
.alert-warn { border-right-color: var(--warn); background: rgba(251,191,36,.06); color: #fde68a; }
.alert-info { border-right-color: var(--brand); background: rgba(139,92,246,.06); color: #ddd6fe; }

/* ==========================================================================
   SECTION HEAD
   ========================================================================== */
.section { padding: 68px 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head .tag { margin-bottom: 12px; }
.tag {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--brand-2); text-transform: uppercase;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 5px 15px; border-radius: 999px;
}
.section-head h2 { font-family: var(--font-head); font-size: clamp(25px, 4vw, 36px); font-weight: 600; margin: 0 0 12px; line-height: 1.3; color: #fff; }
.section-head h2 em { font-style: normal; color: var(--brand-2); }
.section-head p { color: var(--ink-dim); font-size: 15.5px; margin: 0; }

/* ==========================================================================
   HERO — نضيف وهادئ
   ========================================================================== */
.hero {
  position: relative;
  min-height: 84vh;
  display: flex; align-items: center;
  isolation: isolate; overflow: hidden; padding: 60px 0;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(.7); }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(100deg, rgba(10,10,14,.98) 0%, rgba(10,10,14,.85) 35%, rgba(13,13,20,.55) 70%, rgba(10,10,14,.75)),
    radial-gradient(700px 400px at 80% 45%, rgba(139,92,246,.20), transparent 60%);
}
.hero::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 140px; z-index: -1; background: linear-gradient(180deg, transparent, var(--bg)); }

/* توهج بنفسجي بسيط خلفي */
.hero-glow { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-glow span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .25; }
.hero-glow span:nth-child(1) { width: 420px; height: 420px; background: #6d28d9; top: -120px; left: -100px; }
.hero-glow span:nth-child(2) { width: 360px; height: 360px; background: #4c1d95; bottom: -120px; right: -80px; }

.hero .content { max-width: 620px; position: relative; z-index: 2; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--brand-2);
  border: 1px solid rgba(139,92,246,.3); padding: 7px 15px; border-radius: 999px;
  background: rgba(139,92,246,.07); margin-bottom: 24px;
}
.hero .eyebrow .live { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.hero h1 {
  font-family: var(--font-head); font-size: clamp(32px, 5.6vw, 58px);
  font-weight: 600; line-height: 1.2; margin: 0 0 20px; color: #fff;
}
.hero h1 .accent { color: var(--brand-2); }
.hero p { color: var(--ink-2); font-size: 16.5px; max-width: 520px; margin: 0 0 32px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .actions .btn { font-size: 15.5px; padding: 13px 27px; }

/* شرائط حالة تحت الهيرو */
.hero-status { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.hero-status .chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line);
  backdrop-filter: blur(8px); border-radius: 13px; padding: 11px 16px; min-width: 148px;
}
.hero-status .chip .ic {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(139,92,246,.10); border: 1px solid rgba(139,92,246,.25); color: var(--brand-2);
}
.hero-status .chip b { display: block; font-size: 19px; line-height: 1.1; color: #fff; }
.hero-status .chip span { font-size: 11.5px; color: var(--ink-dim); }

/* Logo ثابت على اليمين */
.hero-logo { z-index: 2; }
@media (max-width: 1000px) { .hero-logo { display: none; } }
.hero-logo img { width: min(330px, 60vw); filter: drop-shadow(0 24px 50px rgba(0,0,0,.5)); }

/* ==========================================================================
   STATS STRIP
   ========================================================================== */
.stats-strip { position: relative; z-index: 5; margin-top: -50px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.stat-card {
  background: var(--bg-3); border: 1px solid var(--line);
  backdrop-filter: blur(10px); border-radius: var(--radius);
  padding: 22px 15px; text-align: center;
  transition: transform .25s, border-color .25s, box-shadow .25s; box-shadow: var(--shadow);
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--brand); }
.stat-card .num { font-family: var(--font-mono); font-weight: 600; font-size: clamp(25px, 4vw, 34px); line-height: 1; color: var(--brand-2); }
.stat-card.online .num { color: var(--ok); }
.stat-card.offline .num { color: var(--danger); }
.stat-card .lbl { margin-top: 9px; font-size: 12.5px; color: var(--ink-dim); }

/* ==========================================================================
   FEATURES
   ========================================================================== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.feature {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px;
  transition: transform .25s, border-color .25s, box-shadow .25s, background .25s;
}
.feature:hover { transform: translateY(-5px); border-color: var(--brand); background: var(--paper-2); box-shadow: var(--glow); }
.feature .icon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; background: rgba(139,92,246,.10); border: 1px solid rgba(139,92,246,.22); color: var(--brand-2); }
.feature .icon svg { width: 24px; height: 24px; }
.feature:hover .icon { background: var(--grad); color: #fff; }
.feature h3 { font-family: var(--font-head); font-size: 18.5px; font-weight: 600; margin: 0 0 8px; color: #fff; }
.feature p { color: var(--ink-dim); font-size: 14px; margin: 0; }

/* ==========================================================================
   TOP BOXES
   ========================================================================== */
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.top-box { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.top-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 16px; color: #fff; padding-bottom: 13px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.top-head svg { color: var(--brand-2); }
.top-count { margin-right: auto; font-size: 12px; color: var(--brand-2); background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.25); padding: 2px 10px; border-radius: 999px; }
.top-list { display: flex; flex-direction: column; }
.top-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 11px; transition: background .2s; }
.top-item:hover { background: var(--paper-2); }
.top-pos { font-family: var(--font-mono); font-weight: 700; color: var(--ink-dim); width: 20px; text-align: center; font-size: 13.5px; }
.top-item:nth-child(1) .top-pos { color: var(--brand-2); }
.top-item:nth-child(2) .top-pos { color: #c7c7d4; }
.top-item:nth-child(3) .top-pos { color: #9b7fd4; }
.top-avatar { width: 40px; height: 40px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line-bright); display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 700; color: var(--ink-2); }
.top-avatar img { width: 100%; height: 100%; object-fit: cover; }
.top-info { flex: 1; min-width: 0; }
.top-name { color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-sub { font-size: 11.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-rank { color: var(--brand-2); }
.top-val { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.top-empty { color: var(--ink-dim); padding: 18px 6px; text-align: center; font-size: 14px; }
.staff-banner img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 26px; }

/* ==========================================================================
   PANELS
   ========================================================================== */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-family: var(--font-head); font-size: 16px; font-weight: 600; color: #fff; }
.panel-body { padding: 20px; }

.profile-grid { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 22px; text-align: center; position: relative; overflow: hidden; }
.profile-card::before { content: ''; position: absolute; top: -70px; left: 50%; transform: translateX(-50%); width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.25), transparent 70%); }
.profile-card .avatar { position: relative; width: 104px; height: 104px; margin: 0 auto 15px; border-radius: 26px; background: var(--grad); padding: 3px; }
.profile-card .avatar > * { border-radius: 24px; }
.profile-card .avatar .letter { position: absolute; inset: 3px; display: grid; place-items: center; background: var(--bg-3); font-size: 40px; font-weight: 700; color: #fff; }
.profile-card .avatar img.avatar-img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: cover; z-index: 2; border-radius: 24px; }
.profile-card .uname { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: #fff; }
.profile-card .rank { color: var(--brand-2); font-size: 13px; margin-top: 4px; min-height: 18px; }
.profile-card .meta { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 13px; display: grid; gap: 7px; }
.profile-card .meta > div { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-dim); padding: 6px 10px; border-radius: 9px; background: var(--paper); }
.profile-card .meta span { color: #fff; font-weight: 600; }
.profile-card .meta .vip { color: var(--brand-2); }

.char-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 15px; }
.char-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 17px; transition: transform .2s, border-color .2s; }
.char-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.char-card h4 { font-family: var(--font-head); color: #fff; margin: 0 0 11px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.char-card h4::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); }
.char-card .row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; color: var(--ink-dim); border-bottom: 1px dashed var(--line); }
.char-card .row b { color: var(--ink-2); font-weight: 600; }

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group { margin-bottom: 17px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.form-control { width: 100%; font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-bright); border-radius: 11px; padding: 11px 14px; transition: border-color .2s, box-shadow .2s; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139,92,246,.16); }
.form-control::placeholder { color: #5d5e6e; }
select.form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7d7e92 50%), linear-gradient(135deg, #7d7e92 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
textarea.form-control { min-height: 105px; resize: vertical; }
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* ==========================================================================
   APPLY
   ========================================================================== */
.apply-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 820px) { .apply-grid { grid-template-columns: 1fr; } }
.apply-note { background: rgba(139,92,246,.05); border: 1px solid rgba(139,92,246,.22); border-right: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 15px 19px; font-size: 14px; color: var(--ink-2); margin-bottom: 20px; }
.apply-note b { color: var(--brand-2); }

/* ==========================================================================
   AUTH
   ========================================================================== */
.auth-page { min-height: 78vh; display: flex; align-items: center; justify-content: center; padding: 60px 20px; position: relative; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-3); border: 1px solid var(--line-bright); border-radius: 18px; padding: 34px 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); }
.auth-card h1 { font-family: var(--font-head); font-size: 24px; font-weight: 600; margin: 0 0 6px; color: #fff; text-align: center; }
.auth-card .sub { text-align: center; color: var(--ink-dim); font-size: 13.5px; margin-bottom: 24px; }
.auth-card .sub a { color: var(--brand-2); }

/* ==========================================================================
   STORE
   ========================================================================== */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, border-color .25s, box-shadow .25s; }
.product-card:hover { transform: translateY(-5px); border-color: var(--brand); box-shadow: var(--glow); }
.product-card .img { aspect-ratio: 16/10; position: relative; overflow: hidden; display: grid; place-items: center; background: var(--bg-3); }
.product-card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .img img { transform: scale(1.05); }
.product-card .img .ph { color: var(--brand-2); opacity: .6; }
.product-card .img .ph svg { width: 42px; height: 42px; }
.product-card .body { padding: 17px; display: flex; flex-direction: column; flex: 1; }
.product-card .cat { font-size: 11.5px; color: var(--brand-2); font-weight: 700; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.product-card h3 { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin: 0 0 6px; color: #fff; }
.product-card .desc { color: var(--ink-dim); font-size: 13px; margin-bottom: 13px; flex: 1; }
.product-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.product-card .foot form { margin: 0; }
.product-card .price { font-family: var(--font-mono); font-weight: 600; color: var(--brand-2); font-size: 16px; }

/* ==========================================================================
   RULES
   ========================================================================== */
.rules-list { display: grid; gap: 16px; max-width: 850px; margin: 0 auto; }
.rule-block { background: var(--paper); border: 1px solid var(--line); border-right: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 19px 23px; }
.rule-title { font-family: var(--font-head); font-size: 17px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.rule-title .no { font-family: var(--font-mono); font-size: 13px; color: var(--brand-2); background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.25); padding: 2px 9px; border-radius: 8px; }
.rule-block ul { margin: 0; padding-right: 18px; color: var(--ink-2); font-size: 14.5px; }
.rule-block li { margin: 5px 0; }
.rule-block li::marker { color: var(--brand-2); }

/* ==========================================================================
   MTA
   ========================================================================== */
.dl-steps { display: grid; gap: 16px; max-width: 850px; margin: 0 auto; }
.dl-step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px 26px; border-right: 3px solid var(--brand); }
.dl-step h3 { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: #fff; margin: 0 0 8px; display: flex; align-items: center; gap: 9px; }
.dl-step h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); }
.dl-step p { color: var(--ink-2); margin: 6px 0; }
.dl-step code { display: block; background: var(--bg-2); border: 1px solid var(--line-bright); padding: 9px 13px; border-radius: 8px; color: var(--brand-2); margin-top: 9px; direction: ltr; text-align: left; }

/* ==========================================================================
   TABLES / BADGES
   ========================================================================== */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: right; color: var(--ink-dim); font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 11px 13px; border-bottom: 1px solid var(--line-bright); white-space: nowrap; }
.tbl td { padding: 12px 13px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.tbl tr:hover td { background: var(--paper-2); }
.tbl tr:last-child td { border-bottom: none; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: rgba(74,222,128,.1); color: var(--ok); border: 1px solid rgba(74,222,128,.25); }
.badge-warn { background: rgba(251,191,36,.1); color: var(--warn); border: 1px solid rgba(251,191,36,.25); }
.badge-danger { background: rgba(248,113,113,.1); color: var(--danger); border: 1px solid rgba(248,113,113,.25); }
.badge-info { background: rgba(139,92,246,.1); color: var(--brand-2); border: 1px solid rgba(139,92,246,.25); }
.badge-dim { background: rgba(255,255,255,.05); color: var(--ink-dim); border: 1px solid var(--line); }
.delivery-note { font-size: 11px; color: var(--ink-dim); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-actions form { margin: 0; }
td.app-detail { padding: 0; }
.app-detail td { padding: 0; }
.app-box { padding: 15px 19px; border-top: 1px dashed var(--line); }
.app-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 9px; }
.app-meta div { font-size: 13px; color: var(--ink-2); }
.app-meta span { color: var(--brand-2); font-weight: 700; }
.app-qa { margin-bottom: 11px; }
.app-qa span { font-size: 13px; font-weight: 700; color: var(--brand-2); display: block; margin-bottom: 3px; }
.app-qa p { margin: 0; color: var(--ink-2); font-size: 13.5px; white-space: pre-wrap; }
.app-qa .app-raw { color: var(--ink-dim); }
.rule-editor { border: 1px solid var(--line); padding: 17px; margin-bottom: 13px; border-radius: var(--radius-sm); }

/* ==========================================================================
   ADMIN
   ========================================================================== */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; padding: 40px 0 60px; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-side { position: sticky; top: 94px; display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
@media (max-width: 860px) { .admin-side { position: static; flex-direction: row; flex-wrap: wrap; } }
.admin-side a { display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; transition: .2s; border: 1px solid transparent; }
.admin-side a::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-dim); transition: .2s; }
.admin-side a:hover { background: var(--paper-2); color: #fff; }
.admin-side a.active { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.3); color: #fff; }
.admin-side a.active::before { background: var(--brand); }
.admin-main { min-width: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 24px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px 15px; text-align: center; transition: transform .2s, border-color .2s; }
.kpi:hover { transform: translateY(-4px); border-color: var(--brand); }
.kpi .n { font-family: var(--font-mono); font-weight: 600; font-size: 28px; color: var(--brand-2); }
.kpi .t { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; }

/* ==========================================================================
   ERROR
   ========================================================================== */
.error-page { min-height: 68vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 60px 20px; }
.error-page .code { font-family: var(--font-head); font-size: clamp(80px, 18vw, 180px); font-weight: 600; line-height: 1; color: var(--brand-2); opacity: .9; }
.error-page .msg { color: var(--ink-2); font-size: 19px; margin: 14px 0 28px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { position: relative; margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; padding: 44px 0 28px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { width: 50px; height: 50px; object-fit: contain; border-radius: 12px; margin-bottom: 11px; }
.footer-brand .name { font-family: var(--font-head); font-weight: 600; font-size: 19px; color: #fff; }
.footer-brand .name b { color: var(--brand-2); }
.footer-brand p { color: var(--ink-dim); font-size: 13.5px; margin: 10px 0 0; max-width: 280px; }
.site-footer h4 { font-family: var(--font-head); font-size: 14.5px; color: #fff; margin: 0 0 13px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin: 8px 0; }
.site-footer ul a { color: var(--ink-dim); font-size: 13.5px; }
.site-footer ul a:hover { color: var(--brand-2); }
.site-footer ul li.dim { color: var(--ink-dim); font-size: 13.5px; }
.site-footer ul li .mono { font-family: var(--font-mono); color: var(--brand-2); direction: ltr; display: inline-block; }
.footer-bottom { border-top: 1px solid var(--line); padding: 16px 0 22px; text-align: center; color: var(--ink-dim); font-size: 12.5px; }
.foot-social { display: flex; gap: 9px; margin-top: 13px; }
.foot-social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--line-bright); color: var(--ink-2); transition: .2s; }
.foot-social a:hover { border-color: var(--brand); color: var(--brand-2); }
.foot-social svg { width: 18px; height: 18px; }

/* ==========================================================================
   REVEAL
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .hero { min-height: auto; padding: 84px 0 100px; }
  .header-inner { height: auto; padding: 13px 0; flex-wrap: wrap; }
  .nav-toggle { display: flex; margin-right: auto; }
  .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 0 4px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 15px; text-align: right; }
  .auth-box { width: 100%; justify-content: flex-start; }
}
@media (max-width: 620px) {
  .stats-strip { margin-top: -38px; }
  .topbar .links { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
