@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0f24;
  --panel: #12193a;
  --line: #2a3568;
  --text: #f3f5ff;
  --muted: #96a1c8;
  --blue: #3d6cf5;
  --green: #14b86a;
  --danger: #ff7b7b;
  --shadow: 0 14px 32px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 14px;
  background:
    radial-gradient(800px 380px at 100% -10%, #1d2a6d 0%, transparent 55%),
    linear-gradient(165deg, #171b45, #080b1d 50%, #0b1230);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.panel-shell { min-height: 100vh; display: flex; flex-direction: column; }

.panel-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(9, 13, 32, .96);
  border-bottom: 1px solid rgba(42, 53, 104, .85);
  backdrop-filter: blur(10px);
}
.panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  margin-inline-end: auto;
}
.panel-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #1a2348;
}
.panel-brand span {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff8a3d, #ff5a1f);
}
.panel-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.panel-nav a,
.panel-nav button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #334275;
  background: #12193a;
  color: #d7dff8;
  cursor: pointer;
}
.panel-nav a.active {
  background: linear-gradient(120deg, var(--blue), #4f7cff);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.logout-form { margin: 0; }

.panel-wrap {
  width: min(1100px, calc(100% - 24px));
  margin: 18px auto 40px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h1 { margin: 0; font-size: 22px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 800px) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.card .label { color: var(--muted); font-size: 12px; }
.card .value { margin-top: 6px; font-size: 22px; font-weight: 800; }

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.box h2 { margin: 0 0 12px; font-size: 16px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span, .field > label { color: #b8c4e6; font-size: 12px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: #0d1430;
  border: 1px solid #30406c;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  min-height: 44px;
}
.field textarea { min-height: 90px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; }
.errorlist { color: var(--danger); margin: 4px 0 0; padding: 0 16px; font-size: 12px; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
}
.btn.primary { background: linear-gradient(120deg, var(--blue), #4f7cff); }
.btn.green { background: linear-gradient(120deg, var(--green), #1ad07a); }
.btn.ghost {
  background: #151d40;
  border: 1px solid #334675;
  color: #d5def7;
}
.btn.full { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
table.data th,
table.data td {
  padding: 10px 8px;
  border-bottom: 1px solid #223057;
  text-align: right;
  vertical-align: middle;
}
table.data th { color: #b8c4e6; font-weight: 600; font-size: 12px; }
table.data tr:hover td { background: rgba(255,255,255,.02); }
.thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #e8ebf4;
}
.muted { color: var(--muted); }
.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #1a2348;
  border: 1px solid #334275;
}
.badge.new { background: #102d36; border-color: #0f8a68; color: #5de0a6; }
.badge.processing { background: #1c2752; border-color: #3a4a84; color: #b7c5ff; }
.badge.done { background: #1a2348; color: #c9d4f5; }
.badge.cancelled { background: #3a1b28; border-color: #7f2d44; color: #fb7185; }

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-row input { flex: 1; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 18px; }

.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100% - 24px));
}
.toast {
  background: #152048;
  border: 1px solid #334675;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.toast-wrap.hide { opacity: 0; pointer-events: none; transition: .3s ease; }

.change-item {
  padding: 10px 0;
  border-bottom: 1px solid #223057;
}
.change-item:last-child { border-bottom: 0; }
.diff {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}
.diff .old { color: #fb7185; text-decoration: line-through; }
.diff .new { color: #5de0a6; }

.profile-logo {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  background: #1a2348;
  margin-bottom: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.filters a {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #334275;
  background: #12193a;
}
.filters a.active {
  background: #111827;
  box-shadow: 0 0 0 1px #93a4ff inset;
}

.grid-2 {
  display: grid;
  gap: 14px;
}
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1.1fr .9fr; }
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

.product-edit-preview {
  width: 100%;
  aspect-ratio: 1;
  max-width: 280px;
  border-radius: 16px;
  object-fit: cover;
  background: #e8ebf4;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .panel-top { flex-wrap: wrap; }
  .panel-brand { width: 100%; }
  table.data { min-width: 520px; }
}
