:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --accent: #14b8a6;
  --accent-dark: #0d9488;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --light: #f8fafc;
  --gray: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  background: var(--light);
  color: var(--dark);
  direction: rtl;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; flex-wrap: nowrap; white-space: nowrap; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 900; letter-spacing: -0.5px;
  box-shadow: 0 6px 16px rgba(14,165,233,.35);
  flex-shrink: 0;
}
.logo-text { background: linear-gradient(135deg, var(--primary-dark), var(--accent-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.main-nav { display: flex; gap: 6px; align-items: center; }
nav.main-nav a {
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--dark-2); transition: .2s;
}
nav.main-nav a:hover { background: #e0f2fe; color: var(--primary-dark); }
nav.main-nav a.active { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 10px; font-weight: 600; font-size: 14px; border: none; cursor: pointer;
  transition: .2s; font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 6px 16px rgba(14,165,233,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(14,165,233,.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary-dark); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--gray); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 90px 0 70px;
  background: linear-gradient(135deg, #0f172a 0%, #0c4a6e 50%, #0d9488 100%);
  color: #fff;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(20,184,166,.35), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(14,165,233,.35), transparent 40%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; position: relative; }
.hero h1 { font-size: 46px; line-height: 1.25; font-weight: 900; margin-bottom: 18px; }
.hero h1 span { background: linear-gradient(135deg, #67e8f9, #5eead4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; opacity: .9; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px; padding: 30px; backdrop-filter: blur(8px);
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
}
.hero-visual .code-block {
  font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.8;
  color: #a5f3fc; direction: ltr; text-align: left;
}
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 24px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 28px; font-weight: 900; }
.hero-stat .lbl { font-size: 12px; opacity: .8; }

/* Sections */
.section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 46px; }
.section-title h2 { font-size: 34px; font-weight: 900; margin-bottom: 10px; }
.section-title p { color: var(--gray); font-size: 16px; max-width: 600px; margin: 0 auto; }
.section-title .underline {
  width: 70px; height: 4px; margin: 14px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px;
}

/* Cards */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 16px; color: var(--primary-dark);
}
.card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--gray); font-size: 14px; }

/* Product card */
.product-card { overflow: hidden; padding: 0; }
.product-card .img {
  height: 180px; background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 60px; position: relative;
}
.product-card .img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 20px; }
.product-card .cat { font-size: 12px; color: var(--accent-dark); font-weight: 600; margin-bottom: 6px; }
.product-card .title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.product-card .desc { font-size: 13px; color: var(--gray); margin-bottom: 12px; }
.product-card .foot { display: flex; align-items: center; justify-content: space-between; }
.product-card .price { font-size: 16px; font-weight: 800; color: var(--primary-dark); }

/* Buttons row */
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Forms */
.form-card { background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); border: 1px solid var(--border); max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--dark-2); }
.form-control {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: 14px;
  transition: .2s; background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14,165,233,.12); }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control { cursor: pointer; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { text-align: center; margin-bottom: 8px; }
.auth-box .sub { text-align: center; color: var(--gray); margin-bottom: 24px; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 70px); }
.admin-sidebar { background: var(--dark); color: #fff; padding: 24px 16px; }
.admin-sidebar .brand { font-size: 18px; font-weight: 800; margin-bottom: 24px; padding: 0 8px; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 10px; color: #cbd5e1; font-size: 14px; margin-bottom: 4px; transition: .2s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-sidebar nav a .ic { font-size: 18px; }
.admin-main { padding: 28px; background: #f1f5f9; }
.admin-main h1 { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 900; color: var(--primary-dark); }
.stat-card .lbl { font-size: 13px; color: var(--gray); }
.table-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: right; font-size: 14px; }
th { background: #f8fafc; color: var(--gray); font-weight: 600; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #e0f2fe; color: #0284c7; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* Ticket chat */
.ticket-chat { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.msg { padding: 14px 16px; border-radius: 12px; margin-bottom: 12px; max-width: 80%; }
.msg.user { background: #e0f2fe; margin-right: auto; }
.msg.admin { background: #ccfbf1; margin-left: auto; }
.msg .meta { font-size: 11px; color: var(--gray); margin-bottom: 4px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.info-box { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-radius: var(--radius); padding: 32px; }
.info-box h3 { margin-bottom: 16px; }
.info-box p { opacity: .9; margin-bottom: 10px; }

/* Footer */
.site-footer { background: var(--dark); color: #cbd5e1; padding: 50px 0 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-grid h4 { color: #fff; margin-bottom: 14px; font-size: 16px; }
.footer-grid a { display: block; color: #cbd5e1; font-size: 14px; margin-bottom: 8px; transition: .2s; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; text-align: center; font-size: 13px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #16a34a; }
.alert-error { background: #fee2e2; color: #dc2626; }
.alert-info { background: #e0f2fe; color: #0284c7; }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--gray); }
.empty .ic { font-size: 48px; margin-bottom: 12px; opacity: .5; }

.admin-menu-btn { display: none; }
.mobile-menu-btn { display: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .grid-3, .grid-4, .grid-2, .contact-grid, .footer-grid, .admin-layout, .stat-grid { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-menu-btn { display: inline-flex; position: fixed; top: 12px; right: 12px; z-index: 200; background: var(--dark); color: #fff; border: none; border-radius: 8px; padding: 8px 12px; font-size: 20px; cursor: pointer; }
  .admin-sidebar.open { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: 260px; z-index: 199; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,.3); }
  .admin-main { padding-top: 60px; }
  .hero h1 { font-size: 32px; }
  nav.main-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.12); border-top: 1px solid var(--border); gap: 4px; }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { width: 100%; }
  .mobile-menu-btn { display: inline-flex; }
}
