/* =========================================================
   Pixoris CMS v2.0 - Modern Clean Styles
   Single source of truth - no version overrides
   ========================================================= */

/* ============= VARIABLES ============= */
:root {
  --bg: #070b16;
  --bg-soft: #0d1222;
  --card: rgba(17, 23, 40, 0.88);
  --card-solid: #10172b;
  --line: rgba(255,255,255,.08);
  --text: #f5f7ff;
  --muted: #9aa5c7;
  --cyan: #4ee5ff;
  --purple: #9264ff;
  --pink: #ff4e9c;
  --yellow: #ffd84c;
  --green: #39f37a;
  --orange: #ff7b4e;
  --shadow: 0 22px 70px rgba(0,0,0,.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-main: Tahoma, Arial, sans-serif;
  --font-pixel: "Courier New", monospace;
  --transition: .22s ease;
}

/* ============= RESET & BASE ============= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(146,100,255,.24), transparent 26%),
    radial-gradient(circle at 100% 10%, rgba(78,229,255,.18), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255,78,156,.18), transparent 28%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============= LAYOUT ============= */
.container { width: min(1100px, calc(100% - 34px)); margin: 0 auto; }
.site-shell { position: relative; isolation: isolate; }
.site-shell::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 95%);
}

/* ============= TOPBAR ============= */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(7, 11, 22, .78);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  min-height: 70px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 16px; object-fit: cover;
  box-shadow: 0 0 18px rgba(78,229,255,.28), inset 0 0 0 1px rgba(255,255,255,.08);
  border: 1px solid rgba(78,229,255,.22); background: #070b16;
}
.brand-text h1 { font-size: 23px; line-height: 1; letter-spacing: .5px; }
.brand-text p { color: var(--muted); margin-top: 4px; font-size: 11px; }

/* Navigation */
.nav-links { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.nav-links a {
  padding: 9px 11px; border-radius: 999px; color: var(--muted);
  font-weight: 800; font-size: 13px; transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: white; background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

/* Header Actions */
.header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.header-actions > * { direction: rtl; }

.auth-entry, .pac-toggle, .sound-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.12);
  color: white; font-weight: 900; font-size: 13px;
  padding: 10px 12px; cursor: pointer; transition: var(--transition);
}
.auth-entry {
  background: linear-gradient(135deg, rgba(57,243,122,.11), rgba(146,100,255,.16));
}
.auth-entry:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(57,243,122,.12); }
.pac-toggle {
  background: linear-gradient(135deg, rgba(255,216,76,.18), rgba(146,100,255,.18));
}
.pac-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,216,76,.12); }
.sound-toggle {
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(78,229,255,.14));
  min-width: 118px; justify-content: center;
}
.sound-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(78,229,255,.12); }
.sound-toggle.muted { opacity: .78; }

.auth-pixel {
  width: 16px; height: 16px; display: inline-block;
  background:
    linear-gradient(currentColor 0 0) 4px 0 / 8px 4px no-repeat,
    linear-gradient(currentColor 0 0) 2px 6px / 12px 6px no-repeat,
    linear-gradient(currentColor 0 0) 0 14px / 16px 2px no-repeat;
  color: var(--green);
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(57,243,122,.42));
}
.pac-icon {
  width: 16px; height: 16px; border-radius: 50%; background: var(--yellow);
  clip-path: polygon(100% 0, 50% 50%, 100% 100%, 0 100%, 0 0);
  box-shadow: 0 0 15px rgba(255,216,76,.55);
}
.speaker-pixel {
  position: relative; width: 15px; height: 12px;
  background: currentColor;
  clip-path: polygon(0 35%, 32% 35%, 60% 5%, 60% 95%, 32% 65%, 0 65%);
}
.speaker-pixel::before, .speaker-pixel::after {
  content: ""; position: absolute; top: 12px;
  border: 2px solid transparent;
  border-right-color: currentColor;
  border-top-color: currentColor;
  width: 8px; height: 8px; right: -4px;
  transform: rotate(45deg);
}
.speaker-pixel::after { width: 12px; height: 12px; right: -8px; top: 10px; opacity: .7; }
.sound-toggle.muted .speaker-pixel::before,
.sound-toggle.muted .speaker-pixel::after { opacity: .15; }
.sound-toggle.muted .speaker-pixel { box-shadow: inset 0 0 0 999px rgba(255,255,255,.9); }
.sound-toggle.muted::after {
  content: ""; width: 12px; height: 2px; background: var(--pink);
  transform: rotate(-30deg); margin-inline-start: -4px;
}

.cart-mini {
  display: none; align-items: center; justify-content: center; gap: 4px;
  min-width: 46px; height: 46px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06);
}
.menu-btn {
  display: none; width: 46px; height: 46px; border-radius: 12px;
  align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06);
  color: white; cursor: pointer;
}

/* Cart badges */
.cart-link span, .cart-mini span {
  min-width: 20px; height: 20px; display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--pink); color: white;
  font-size: 11px; margin-inline-start: 4px;
}

/* Mobile Nav */
.mobile-nav { display: none; padding-bottom: 16px; }
.mobile-nav.open { display: grid; gap: 8px; }
.mobile-nav a {
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06);
  color: var(--muted); font-weight: 800;
}

/* ============= HERO ============= */
.hero { padding: 28px 0 20px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.hero-panel, .panel {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.hero-panel { padding: 26px; overflow: hidden; position: relative; min-height: 360px; }
.hero-panel::after {
  content: ""; position: absolute; width: 280px; height: 280px;
  right: -40px; bottom: -60px;
  background: radial-gradient(circle, rgba(255,78,156,.35), transparent 65%);
  filter: blur(10px);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06);
  color: #dbeafe; font-size: 13px; font-weight: 800;
}
.hero-title {
  font-size: clamp(30px, 4.2vw, 52px); line-height: 1.18;
  margin-top: 12px; max-width: 680px;
}
.shine-text {
  background: linear-gradient(90deg, var(--cyan), white, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shine 4s linear infinite;
}
.hero-desc {
  color: var(--muted); max-width: 620px; font-size: 15px;
  line-height: 1.9; margin-top: 12px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 15px; border-radius: 13px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white; font-weight: 900; font-size: 14px;
  min-width: 118px; transition: var(--transition); cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-outline {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1);
}
.btn-sm { padding: 8px 12px; font-size: 12px; min-width: auto; }
.btn-danger {
  background: linear-gradient(135deg, #ff4e4e, var(--pink));
}
.btn-success {
  background: linear-gradient(135deg, var(--green), #2dd4bf);
}

/* ============= SECTIONS ============= */
.section { padding: 34px 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 16px; margin-bottom: 18px;
}
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--muted); margin-top: 6px; line-height: 1.8; font-size: 14px; }

/* ============= CARDS ============= */
.cards-grid, .grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card, .post-card-clean, .product-tile {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition);
}
.card:hover, .post-card-clean:hover, .product-tile:hover {
  transform: translateY(-5px); border-color: rgba(78,229,255,.3);
}
.media-thumb { aspect-ratio: 16 / 10; overflow: hidden; display: block; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; }
.card-body h3 { font-size: 17px; line-height: 1.7; }
.card-body p { color: var(--muted); line-height: 1.85; margin-top: 8px; font-size: 13px; }

.meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px;
}
.tag {
  border-radius: 999px; background: rgba(255,255,255,.07);
  color: white; padding: 5px 9px; border: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
}
.read-more { display: inline-flex; margin-top: 12px; color: var(--cyan); font-weight: 900; font-size: 13px; }

/* Product */
.product-price {
  display: inline-flex; align-items: center; gap: 8px;
  color: #ffe785; background: rgba(255,216,76,.12);
  border: 1px solid rgba(255,216,76,.22); border-radius: 12px;
  padding: 8px 11px; font-size: 15px; font-weight: 900;
}
.product-price span { color: #fff3b0; font-size: 12px; }
.product-actions { display: flex; gap: 8px; margin-top: 12px; }

/* KPI */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.kpi {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; padding: 16px;
}
.kpi strong { display: block; font-size: 24px; }
.kpi span { color: var(--muted); font-size: 12px; margin-top: 6px; display: block; }

/* ============= POSTS ============= */
.featured-posts { display: grid; grid-template-columns: 1.35fr .85fr; gap: 16px; }
.post-layout { display: grid; grid-template-columns: minmax(260px, .95fr) 1.4fr; gap: 18px; align-items: start; }
.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.post-card-clean { border-radius: 22px; }
.post-card-clean .post-media { display: block; background: rgba(255,255,255,.035); min-height: 160px; }
.post-card-clean .post-media img { width: 100%; height: 170px; object-fit: cover; }
.post-card-clean .post-content { padding: 16px; display: grid; gap: 10px; }
.post-card-clean h3 { line-height: 1.7; font-size: 17px; }
.post-card-clean p { color: var(--muted); line-height: 1.85; font-size: 13px; }
.post-featured .post-media img { height: 220px; }
.post-wide { display: grid; grid-template-columns: 44% 1fr; align-items: stretch; }
.post-wide .post-media img { height: 100%; min-height: 220px; }

/* Product showcase */
.product-showcase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product-tile { border-radius: 24px; }
.product-media { display: block; background: rgba(255,255,255,.035); }
.product-media img { width: 100%; height: 170px; object-fit: cover; }
.product-tile-body { padding: 16px; display: grid; gap: 8px; }
.product-tile-body p { color: var(--muted); line-height: 1.85; font-size: 13px; }

/* Quick tiles */
.home-quick-panel { display: grid; gap: 14px; }
.quick-tile {
  min-height: 160px; border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  padding: 18px; box-shadow: var(--shadow); display: grid; align-content: end;
  overflow: hidden; position: relative; transition: var(--transition);
}
.quick-tile:hover { transform: translateY(-3px); border-color: rgba(78,229,255,.2); }
.quick-tile img { position: absolute; width: 140px; left: 10px; top: 10px; opacity: .38; }
.quick-tile span { color: var(--muted); font-weight: 800; font-size: 13px; }
.quick-tile strong { font-size: 20px; }

/* ============= ARTICLE / PRODUCT DETAIL ============= */
.article-layout, .product-detail, .cart-page {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow); overflow: hidden;
}
.article-cover { aspect-ratio: 16 / 7; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.08); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-content { padding: clamp(20px, 4vw, 36px); max-width: 900px; margin: 0 auto; }
.article-content h1 { font-size: clamp(28px, 4.5vw, 48px); line-height: 1.25; margin: 14px 0; }
.article-content p { color: var(--muted); line-height: 2; font-size: 15px; margin: 12px 0; }
.article-content h2 { margin-top: 26px; font-size: 24px; }
.article-info { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.article-loading { padding: 40px; color: var(--muted); text-align: center; }

.product-detail-inner { display: grid; grid-template-columns: .95fr 1.05fr; gap: 24px; padding: clamp(18px, 3vw, 28px); }
.product-gallery { border-radius: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); }
.product-gallery img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }
.product-info h1 { font-size: clamp(28px, 4.5vw, 48px); line-height: 1.25; margin: 12px 0; }
.product-info p { color: var(--muted); line-height: 1.9; font-size: 15px; }
.product-feature-list { margin-top: 14px; display: grid; gap: 8px; }
.product-feature-list li {
  list-style: none; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.07);
  color: #e8edff; font-size: 14px;
}

/* ============= CART ============= */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 14px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: right; }
.cart-table th { color: var(--muted); font-size: 12px; }
.cart-product { display: flex; align-items: center; gap: 10px; }
.cart-product img { width: 64px; height: 50px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
.qty-control {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 5px; background: rgba(255,255,255,.04);
}
.qty-control button, .remove-btn {
  border: 0; color: white; background: rgba(255,255,255,.08);
  border-radius: 8px; min-width: 26px; height: 26px; cursor: pointer; font-weight: 900; font-size: 13px;
}
.remove-btn { background: rgba(255,78,156,.18); padding: 0 8px; }
.cart-summary { padding: 20px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.cart-summary strong { color: var(--yellow); font-size: 24px; }
.empty-cart { padding: 44px 20px; text-align: center; }
.empty-cart h3 { font-size: 24px; margin-bottom: 8px; }
.empty-cart p { color: var(--muted); line-height: 1.8; margin-bottom: 18px; }

/* ============= AUTH ============= */
.auth-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; align-items: start; }
.auth-panel { padding: clamp(18px, 3vw, 26px); }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08);
  padding: 6px; border-radius: 16px; margin-bottom: 16px;
}
.auth-tab {
  border: 0; padding: 10px; border-radius: 10px;
  color: var(--muted); background: transparent;
  font-weight: 900; cursor: pointer; font-size: 14px;
}
.auth-tab.active { color: #050713; background: linear-gradient(135deg, var(--cyan), var(--green)); }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; color: #e8edff; font-weight: 900; font-size: 14px; }
.auth-form input {
  width: 100%; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.055); color: white;
  outline: 0; border-radius: 12px; padding: 12px 13px;
  font-family: inherit; font-size: 14px;
}
.auth-form input:focus {
  border-color: rgba(78,229,255,.42);
  box-shadow: 0 0 0 4px rgba(78,229,255,.08);
}
.auth-form input[name="username"], .auth-form input[name="email"], .auth-form input[name="password"] {
  direction: ltr; text-align: left;
}
.auth-submit { width: 100%; margin-top: 4px; }

.role-info-card, .current-account-card {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.045); border-radius: 16px;
  padding: 14px; margin-top: 12px;
}
.role-info-card h3, .current-account-card h3 { margin-bottom: 6px; font-size: 16px; }
.role-info-card p, .current-account-card p { color: var(--muted); line-height: 1.9; font-size: 13px; }
.role-badge {
  display: inline-flex; padding: 6px 10px; border-radius: 999px;
  background: rgba(57,243,122,.14); color: #bfffd4;
  border: 1px solid rgba(57,243,122,.18); font-weight: 900; font-size: 12px; margin-top: 8px;
}
.logout-btn { margin-top: 12px; }

/* ============= ADMIN PANEL ============= */
.admin-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.admin-login-card { padding: 20px; }
.admin-login-card p { color: var(--muted); line-height: 1.9; margin: 8px 0 14px; font-size: 13px; }
.admin-dashboard { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.admin-stat {
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(180deg, rgba(78,229,255,.08), rgba(255,255,255,.03));
  padding: 18px;
}
.admin-stat span { color: var(--muted); font-weight: 900; font-size: 12px; }
.admin-stat strong { display: block; font-size: 36px; margin: 10px 0; }
.admin-stat p { color: var(--muted); line-height: 1.7; font-size: 13px; }

/* Admin CMS Styles */
.admin-cms { padding: 20px 0; }
.admin-sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; position: sticky; top: 90px;
}
.admin-sidebar h3 { font-size: 18px; margin-bottom: 16px; }
.admin-sidebar nav { display: grid; gap: 6px; }
.admin-sidebar nav a {
  padding: 10px 12px; border-radius: 10px; color: var(--muted);
  font-weight: 800; font-size: 13px; transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  color: white; background: rgba(255,255,255,.08);
}
.admin-content { min-height: 500px; }

/* Editor */
.editor-field { margin-bottom: 16px; }
.editor-field label { display: block; margin-bottom: 6px; color: #e8edff; font-weight: 900; font-size: 14px; }
.editor-field input, .editor-field textarea, .editor-field select {
  width: 100%; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.055); color: white;
  outline: 0; border-radius: 12px; padding: 12px 13px;
  font-family: inherit; font-size: 14px;
}
.editor-field input:focus, .editor-field textarea:focus, .editor-field select:focus {
  border-color: rgba(78,229,255,.42);
  box-shadow: 0 0 0 4px rgba(78,229,255,.08);
}
.editor-field textarea { min-height: 200px; resize: vertical; line-height: 1.8; }
.editor-field select { cursor: pointer; }
.editor-field select option { background: var(--bg-solid); color: var(--text); }

/* Rich Text Toolbar */
.editor-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px; background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px 10px 0 0;
  border-bottom: 0;
}
.editor-toolbar button {
  padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06); color: var(--muted);
  font-weight: 800; font-size: 12px; cursor: pointer; transition: var(--transition);
}
.editor-toolbar button:hover { background: rgba(255,255,255,.1); color: white; }
.editor-toolbar button.active { background: rgba(78,229,255,.15); color: var(--cyan); border-color: rgba(78,229,255,.3); }

/* Media Grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-item {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  cursor: pointer; position: relative; transition: var(--transition);
}
.media-item:hover { border-color: var(--cyan); transform: scale(1.02); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item.selected { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(78,229,255,.2); }
.media-item .media-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.7); padding: 4px 8px;
  font-size: 10px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(255,255,255,.15); border-radius: 16px;
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: var(--transition); background: rgba(255,255,255,.02);
}
.upload-zone:hover { border-color: var(--cyan); background: rgba(78,229,255,.04); }
.upload-zone.dragover { border-color: var(--green); background: rgba(57,243,122,.06); }
.upload-zone p { color: var(--muted); margin-top: 10px; font-size: 13px; }

/* Post List Table */
.posts-table { width: 100%; border-collapse: collapse; }
.posts-table th, .posts-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; }
.posts-table th { color: var(--muted); font-weight: 800; }
.posts-table td { color: var(--text); }
.posts-table .post-status { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.post-status.published { background: rgba(57,243,122,.14); color: #bfffd4; }
.post-status.draft { background: rgba(255,216,76,.14); color: #fff0a5; }
.post-actions { display: flex; gap: 6px; }

/* ============= PIXEL DECOR ============= */
.pixel-decor { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.decor-column { position: fixed; top: 90px; bottom: 24px; width: clamp(90px, 8vw, 126px); pointer-events: none; }
.decor-left { left: 10px; }
.decor-right { right: 10px; }

@keyframes decorFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
@keyframes decorPulse {
  0%,100% { opacity: .28; }
  50% { opacity: .42; }
}
.decor-item {
  position: absolute; width: clamp(66px, 6.7vw, 96px); height: clamp(70px, 9.4vh, 104px);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; overflow: visible; mix-blend-mode: screen;
  animation: decorFloat 7s ease-in-out infinite, decorPulse 7s ease-in-out infinite;
  transition: transform .25s ease, opacity .25s ease;
}
.decor-item img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; object-position: center center; image-rendering: pixelated;
  filter: grayscale(1) brightness(3.3) contrast(1.26) drop-shadow(0 0 12px rgba(255,255,255,.26));
  opacity: .95;
}
.decor-item:hover { opacity: .72; z-index: 4; }
.decor-item:hover img { filter: grayscale(1) brightness(4.1) contrast(1.35) drop-shadow(0 0 18px rgba(255,255,255,.54)); transform: scale(1.08); }

.decor-left .d1 { top: 0%; left: 3px; animation-delay: 0s, 0s; }
.decor-left .d2 { top: 13%; right: 0; animation-delay: -.8s, -.8s; }
.decor-left .d3 { top: 27%; left: 6px; animation-delay: -1.6s, -1.6s; }
.decor-left .d4 { top: 41%; right: 2px; animation-delay: -2.4s, -2.4s; }
.decor-left .d5 { top: 55%; left: 8px; animation-delay: -3.2s, -3.2s; }
.decor-left .d6 { top: 69%; right: 3px; animation-delay: -4s, -4s; }
.decor-left .d7 { top: 83%; left: 10px; animation-delay: -4.8s, -4.8s; }
.decor-right .d8 { top: 0%; right: 4px; animation-delay: -.4s, -.4s; }
.decor-right .d9 { top: 13%; left: 0; animation-delay: -1.2s, -1.2s; }
.decor-right .d10 { top: 27%; right: 5px; animation-delay: -2s, -2s; }
.decor-right .d11 { top: 41%; left: 2px; animation-delay: -2.8s, -2.8s; }
.decor-right .d12 { top: 55%; right: 6px; animation-delay: -3.6s, -3.6s; }
.decor-right .d13 { top: 69%; left: 4px; animation-delay: -4.4s, -4.4s; }
.decor-right .d14 { top: 83%; right: 8px; animation-delay: -5.2s, -5.2s; }

/* ============= PIXEL OVERLAY (Pac Mode) ============= */
.pixel-overlay { position: fixed; inset: 0; z-index: 200; pointer-events: none; display: none; overflow: hidden; }
.pixel-overlay.show { display: block; }
.pixel-overlay .scan { position: absolute; inset: 0; background: rgba(0,0,0,.24); }
.pacman-runner, .ghost-runner, .cherry-runner, .pellet { position: absolute; top: 50%; transform: translateY(-50%); }
.pacman-runner {
  width: 58px; height: 58px; border-radius: 50%; background: var(--yellow);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  right: -88px; filter: drop-shadow(0 0 20px rgba(255,216,76,.8));
}
.cherry-runner { right: 50%; font-size: 30px; }
.pellet { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 12px rgba(255,216,76,.6); }
.p1 { right: 62%; } .p2 { right: 56%; } .p3 { right: 53%; }
.ghost-runner {
  width: 48px; height: 52px; border-radius: 24px 24px 6px 6px;
  background: var(--pink); right: -100px; display: none;
}
.ghost-runner::before, .ghost-runner::after {
  content: ""; position: absolute; top: 12px; width: 10px; height: 10px;
  border-radius: 50%; background: white;
}
.ghost-runner::before { right: 11px; } .ghost-runner::after { right: 27px; }
.ghost-2 { background: var(--cyan); } .ghost-3 { background: #8fe27d; }

.pixel-overlay.show:not(.reverse) .pacman-runner { animation: pacForward 2s ease-in-out forwards; }
.pixel-overlay.show:not(.reverse) .cherry-runner { animation: cherryGone 2s ease forwards; }
.pixel-overlay.show:not(.reverse) .pellet { animation: pelletFade 1.4s ease forwards; }
.pixel-overlay.show.reverse .pacman-runner { right: calc(50% - 45px); transform: translateY(-50%) scaleX(-1); animation: pacEscape 2s ease-in-out forwards; }
.pixel-overlay.show.reverse .ghost-runner { display: block; }
.pixel-overlay.show.reverse .ghost-1 { animation: ghostHunt 2s ease-in-out forwards; }
.pixel-overlay.show.reverse .ghost-2 { animation: ghostHunt 2s .16s ease-in-out forwards; }
.pixel-overlay.show.reverse .ghost-3 { animation: ghostHunt 2s .28s ease-in-out forwards; }

/* ============= PIXEL MODE ============= */
body.pixel-mode { font-family: var(--font-pixel); }
body.pixel-mode .site-shell::before { background-size: 18px 18px; }
body.pixel-mode .panel, body.pixel-mode .card, body.pixel-mode .hero-panel,
body.pixel-mode .side-card, body.pixel-mode .kpi, body.pixel-mode .about-box,
body.pixel-mode .admin-stat, body.pixel-mode .admin-sidebar {
  border-radius: 4px !important;
  box-shadow: 8px 8px 0 rgba(0,0,0,.22), 0 0 0 2px rgba(255,255,255,.08);
}
body.pixel-mode .brand-logo, body.pixel-mode img { image-rendering: pixelated; }
body.pixel-mode .nav-links a, body.pixel-mode .pill, body.pixel-mode .tag,
body.pixel-mode .btn, body.pixel-mode .pac-toggle, body.pixel-mode .auth-entry,
body.pixel-mode .sound-toggle {
  border-radius: 3px !important;
}
body.pixel-mode h1, body.pixel-mode h2, body.pixel-mode h3,
body.pixel-mode p, body.pixel-mode a, body.pixel-mode span, body.pixel-mode button {
  text-shadow: 2px 2px 0 rgba(0,0,0,.25); letter-spacing: .3px;
}
body.pixel-mode .shine-text { color: var(--yellow) !important; background: none !important; -webkit-background-clip: initial !important; background-clip: initial !important; }

/* ============= FOOTER ============= */
.footer { margin-top: 36px; border-top: 1px solid var(--line); padding: 24px 0 32px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: 13px; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 11px; font-weight: 800; color: #e7ecff; border-radius: 999px; padding: 6px 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }

/* ============= TOAST ============= */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  background: rgba(8,12,24,.92); color: white;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 12px 16px; box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: .25s ease; font-size: 14px;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ============= REVEAL ANIMATION ============= */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .35s ease, transform .35s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============= LOADING ============= */
.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.1); border-top-color: var(--cyan);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%; animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============= SEARCH ============= */
.search-box {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.search-box input {
  flex: 1; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.055); color: white;
  outline: 0; border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 14px;
}
.search-box input:focus { border-color: rgba(78,229,255,.42); box-shadow: 0 0 0 4px rgba(78,229,255,.08); }

/* ============= PAGINATION ============= */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination button {
  padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06); color: var(--muted);
  font-weight: 800; font-size: 13px; cursor: pointer; transition: var(--transition);
}
.pagination button:hover { background: rgba(255,255,255,.1); color: white; }
.pagination button.active { background: linear-gradient(135deg, var(--purple), var(--pink)); color: white; border-color: transparent; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ============= KEYFRAMES ============= */
@keyframes shine { from { background-position: 0% center; } to { background-position: 200% center; } }
@keyframes pacForward { 0% { right: -88px; } 54% { right: calc(50% - 45px); } 75% { right: calc(50% - 45px); } 100% { right: 110%; } }
@keyframes cherryGone { 0%, 54% { opacity: 1; transform: translateY(-50%) scale(1); } 70%, 100% { opacity: 0; transform: translateY(-50%) scale(.15); } }
@keyframes pelletFade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pacEscape { 0% { right: calc(50% - 45px); } 100% { right: 110%; } }
@keyframes ghostHunt { 0% { right: -100px; } 100% { right: 112%; } }

/* ============= RESPONSIVE ============= */
@media (max-width: 1040px) {
  .hero-grid, .about-wrap, .grid-3, .cards-grid, .grid-2, .kpi-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .mobile-nav.open { display: grid; }
  .hero-grid, .about-wrap, .grid-3, .cards-grid, .grid-2, .kpi-strip,
  .post-layout, .featured-posts, .post-list, .product-showcase-grid,
  .admin-layout, .admin-dashboard, .auth-grid { grid-template-columns: 1fr; }
  .post-wide { grid-template-columns: 1fr; }
  .post-wide .post-media img, .post-card-clean .post-media img, .post-featured .post-media img { height: 170px; }
  .cart-mini { display: inline-flex; }
  .product-detail-inner { grid-template-columns: 1fr; }
  .product-gallery img { min-height: 280px; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table thead { display: none; }
  .cart-table tr { border-bottom: 1px solid rgba(255,255,255,.08); padding: 10px; }
  .cart-table td { border: 0; padding: 8px 0; }
  .decor-column { opacity: .65; }
}

@media (max-width: 760px) {
  .pixel-decor { display: none; }
  .header-actions .auth-label, .header-actions .sound-label, .header-actions .pac-toggle .label { display: none; }
  .auth-entry, .sound-toggle, .pac-toggle { width: 46px; height: 46px; min-width: 46px; padding: 0; justify-content: center; }
  .sound-toggle { min-width: 46px; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 22px, 1100px); }
  .hero-panel { padding: 20px; min-height: auto; }
  .hero-title { font-size: clamp(26px, 8vw, 36px); }
  .home-quick-panel { grid-template-columns: 1fr; }
  .quick-tile { min-height: 135px; }
  .quick-tile img { width: 120px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .post-card-clean .post-content, .product-tile-body { padding: 14px; }
  .brand-text p { display: none; }
  .section { padding: 26px 0; }
}


/* ============= RTE (Rich Text Editor) ============= */
.rte-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px 12px 0 0;
  border-bottom: 0;
  align-items: center;
}

.rte-toolbar button {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 34px;
  text-align: center;
}

.rte-toolbar button:hover {
  background: rgba(255,255,255,.12);
  color: white;
}

.rte-toolbar button:active {
  transform: scale(0.95);
}

.rte-toolbar .toolbar-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.1);
  margin: 0 4px;
}

.rte-editor {
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 0 0 12px 12px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
  outline: none;
}

.rte-editor:focus {
  border-color: rgba(78,229,255,.3);
  box-shadow: 0 0 0 3px rgba(78,229,255,.06);
}

.rte-editor:empty::before {
  content: "محتوای مقاله را اینجا بنویسید...";
  color: var(--muted);
  opacity: 0.6;
}

.rte-editor h1 { font-size: 28px; margin: 16px 0 12px; font-weight: 800; }
.rte-editor h2 { font-size: 22px; margin: 14px 0 10px; font-weight: 800; }
.rte-editor p { margin: 8px 0; line-height: 1.9; }
.rte-editor ul, .rte-editor ol { margin: 8px 0; padding-right: 24px; }
.rte-editor li { margin: 4px 0; }
.rte-editor img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.rte-editor a { color: var(--cyan); text-decoration: underline; }
.rte-editor blockquote {
  border-right: 3px solid var(--purple);
  padding: 8px 16px;
  margin: 12px 0;
  background: rgba(146,100,255,.08);
  border-radius: 0 8px 8px 0;
}
.rte-editor b, .rte-editor strong { font-weight: 800; }
.rte-editor i, .rte-editor em { font-style: italic; }
.rte-editor s, .rte-editor strike { text-decoration: line-through; }
