/* =========================================================
   پنل مدیریت دنا — استایل اختصاصی ادمین
   از توکن‌های رنگی style.css استفاده می‌کند (طلایی + آبی + شیشه‌ای)
   ========================================================= */

.admin-body{ min-height:100vh; }

/* ---------- Login screen ---------- */
.admin-login{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(244,180,0,.14), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(10,61,145,.35), transparent 60%),
    var(--ink);
}
.admin-login[hidden]{ display:none; }
.login-card{ width:100%; max-width:400px; padding:44px 36px; text-align:center; }
.login-card h1{ font-size:22px; font-weight:800; color:var(--text-1); margin-bottom:6px; }
.login-sub{ color:var(--text-2); font-size:13.5px; margin-bottom:26px; }
#loginForm{ display:flex; flex-direction:column; gap:6px; text-align:start; }
#loginForm label{ font-size:12.5px; color:var(--text-2); margin-top:10px; }
#loginForm input{
  padding:13px 16px; border-radius:12px; background:rgba(255,255,255,.05);
  border:1px solid var(--glass-border); color:var(--text-1); font-family:inherit; font-size:14px;
}
.login-error{ color:#ff6b6b; font-size:13px; margin-top:10px; text-align:center; }
.login-hint{ color:var(--text-2); font-size:11.5px; margin-top:16px; text-align:center; opacity:.75; }
.back-to-site{ display:block; margin-top:22px; color:var(--gold-light); font-size:13px; }

/* ---------- Shell layout ---------- */
.admin-shell{ display:flex; min-height:100vh; background:var(--ink); }

.admin-sidebar{
  width:264px; flex-shrink:0; background:var(--ink-2); border-inline-end:1px solid var(--glass-border);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh; transition:margin .35s var(--ease), width .35s var(--ease);
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:22px 20px; border-bottom:1px solid var(--glass-border); }
.sidebar-brand svg{ width:32px; height:32px; flex-shrink:0; }
.sidebar-brand span{ font-weight:800; color:var(--gold-light); font-size:15px; }
.sidebar-nav{ flex:1; overflow-y:auto; padding:16px 12px; display:flex; flex-direction:column; gap:4px; }
.sidebar-nav a{
  display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius:12px;
  color:var(--text-2); font-size:14px; transition:background .25s, color .25s;
  position:relative;
}
.sidebar-nav a svg{ width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; flex-shrink:0; }
.sidebar-nav a:hover{ background:rgba(244,180,0,.08); color:var(--text-1); }
.sidebar-nav a.active{ background:linear-gradient(90deg, rgba(244,180,0,.18), transparent); color:var(--gold-light); font-weight:600; }
.nav-badge{
  margin-inline-start:auto; background:var(--gold); color:var(--blue-deep); font-size:10.5px; font-weight:800;
  border-radius:999px; padding:2px 7px; min-width:18px; text-align:center;
}
.sidebar-footer{ padding:16px 20px; border-top:1px solid var(--glass-border); }
.view-site-link{ display:flex; align-items:center; gap:8px; color:var(--text-2); font-size:13px; }
.view-site-link svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; }

.admin-main{ flex:1; min-width:0; display:flex; flex-direction:column; }

.admin-topbar{
  display:flex; align-items:center; gap:16px; padding:16px 28px; border-bottom:1px solid var(--glass-border);
  background:var(--glass-bg); backdrop-filter:blur(12px); position:sticky; top:0; z-index:20;
}
.sidebar-toggle{ display:none; flex-direction:column; gap:4px; width:32px; }
.sidebar-toggle span{ width:100%; height:2px; background:var(--gold-light); border-radius:2px; }
.page-title{ font-size:18px; font-weight:800; color:var(--text-1); }
.topbar-actions{ margin-inline-start:auto; display:flex; align-items:center; gap:14px; }
.admin-user{ display:flex; align-items:center; gap:10px; }
.admin-user span{ font-size:13.5px; color:var(--text-2); }
.logout-btn{ padding:8px 16px; font-size:13px; }

.admin-content{ padding:28px; flex:1; }
.admin-section{ display:none; animation:fadeSection .4s var(--ease); }
.admin-section.active{ display:block; }
@keyframes fadeSection{ from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

/* ---------- Dashboard stat cards ---------- */
.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:18px; margin-bottom:28px; }
.stat-card{ padding:22px; display:flex; flex-direction:column; gap:6px; }
.stat-card .stat-icon{ width:38px; height:38px; border-radius:11px; background:linear-gradient(135deg,var(--gold-light),var(--gold)); display:grid; place-items:center; margin-bottom:8px; }
.stat-card .stat-icon svg{ width:19px; height:19px; stroke:var(--blue-deep); fill:none; stroke-width:2; }
.stat-card strong{ font-size:28px; color:var(--text-1); font-weight:800; }
.stat-card span{ color:var(--text-2); font-size:13px; }

.dash-grid{ display:grid; grid-template-columns:1.4fr 1fr; gap:20px; }
@media (max-width:980px){ .dash-grid{ grid-template-columns:1fr; } }
.dash-panel{ padding:22px; }
.dash-panel h3{ font-size:15px; margin-bottom:16px; color:var(--text-1); }

/* simple bar chart (canvas) */
#ordersChart{ width:100%; height:220px; }

/* ---------- Tables ---------- */
.table-toolbar{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.table-toolbar h3{ font-size:16px; color:var(--text-1); }
.table-toolbar input[type="text"]{
  padding:9px 14px; border-radius:10px; background:rgba(255,255,255,.05); border:1px solid var(--glass-border);
  color:var(--text-1); font-family:inherit; font-size:13px; min-width:200px;
}
.admin-table-wrap{ overflow-x:auto; border-radius:16px; border:1px solid var(--glass-border); }
table.admin-table{ width:100%; border-collapse:collapse; min-width:560px; }
.admin-table th, .admin-table td{ padding:13px 16px; text-align:start; font-size:13.5px; border-bottom:1px solid var(--glass-border); color:var(--text-2); white-space:nowrap; }
.admin-table th{ color:var(--gold-light); font-weight:700; background:rgba(255,255,255,.03); }
.admin-table tr:last-child td{ border-bottom:none; }
.admin-table td.wrap{ white-space:normal; max-width:280px; }
.status-pill{ padding:4px 12px; border-radius:999px; font-size:12px; font-weight:600; display:inline-block; }
.status-پرداخت{ background:rgba(255,107,107,.15); color:#ff9b9b; }
.status-ترجمه{ background:rgba(244,180,0,.15); color:var(--gold-light); }
.status-تحویل{ background:rgba(80,170,255,.15); color:#8ec9ff; }
.status-شده{ background:rgba(70,200,140,.15); color:#7fe0b8; }
.row-actions{ display:flex; gap:6px; }
.row-actions button{
  width:30px; height:30px; border-radius:8px; display:grid; place-items:center; background:rgba(255,255,255,.05);
  border:1px solid var(--glass-border); transition:background .2s;
}
.row-actions button:hover{ background:rgba(244,180,0,.15); }
.row-actions svg{ width:14px; height:14px; stroke:var(--text-1); fill:none; stroke-width:2; }
.row-actions .danger:hover{ background:rgba(255,80,80,.2); }
.empty-state{ text-align:center; padding:40px 20px; color:var(--text-2); font-size:14px; }

/* ---------- Forms (content / appearance / contact settings) ---------- */
.admin-form{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.admin-form.single{ grid-template-columns:1fr; max-width:640px; }
.form-field{ display:flex; flex-direction:column; gap:6px; }
.form-field.full{ grid-column:1 / -1; }
.form-field label{ font-size:12.5px; color:var(--text-2); }
.form-field input, .form-field textarea, .form-field select{
  padding:12px 16px; border-radius:12px; background:rgba(255,255,255,.05); border:1px solid var(--glass-border);
  color:var(--text-1); font-family:inherit; font-size:14px;
}
.form-field textarea{ resize:vertical; }
.form-actions{ grid-column:1 / -1; display:flex; gap:12px; margin-top:8px; }
.color-field{ display:flex; align-items:center; gap:12px; }
.color-field input[type="color"]{ width:52px; height:40px; padding:2px; border-radius:10px; background:none; cursor:pointer; }
.color-swatch-row{ display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; }
.color-swatch{ width:56px; height:56px; border-radius:14px; border:2px solid var(--glass-border); }

/* ---------- Modal ---------- */
.admin-modal{
  position:fixed; inset:0; z-index:900; background:rgba(3,10,25,.7); backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.admin-modal[hidden]{ display:none; }
.modal-box{ width:100%; max-width:520px; padding:30px; max-height:88vh; overflow-y:auto; }
.modal-box h3{ font-size:17px; margin-bottom:18px; color:var(--text-1); }
.modal-close-row{ display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }

/* ---------- Toast ---------- */
.admin-toast{
  position:fixed; bottom:24px; inset-inline-end:24px; z-index:1000; padding:14px 22px; border-radius:14px;
  background:linear-gradient(135deg,var(--gold-light),var(--gold)); color:var(--blue-deep); font-weight:700; font-size:13.5px;
  box-shadow:0 12px 30px rgba(0,0,0,.35); animation:toastIn .3s var(--ease);
}
@keyframes toastIn{ from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:translateY(0);} }

/* ---------- Responsive ---------- */
@media (max-width:900px){
  .sidebar-toggle{ display:flex; }
  .admin-sidebar{ position:fixed; z-index:80; margin-inline-start:-264px; box-shadow:0 0 40px rgba(0,0,0,.4); }
  .admin-sidebar.open{ margin-inline-start:0; }
  .admin-form{ grid-template-columns:1fr; }
}
