/**
 * Vatamam - Panel UI v5
 * طراحی مینیمال و حرفه‌ای برای پنل مشتری، کارشناس و ادمین
 */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* ════════ DESIGN TOKENS ════════ */
:root {
  --p-blue:       #2563eb;
  --p-blue-d:     #1e40af;
  --p-blue-xl:    #eff6ff;
  --p-blue-l:     #dbeafe;
  --p-green:      #059669;
  --p-green-d:    #065f46;
  --p-green-xl:   #ecfdf5;
  --p-green-l:    #d1fae5;
  --p-amber:      #d97706;
  --p-red:        #dc2626;
  --p-surface:    #f8fafc;
  --p-card:       #ffffff;
  --p-border:     #e5e7eb;
  --p-border-l:   #f3f4f6;
  --p-muted:      #6b7280;
  --p-text:       #374151;
  --p-title:      #111827;
  --p-radius-sm:  6px;
  --p-radius:     10px;
  --p-radius-lg:  14px;
  --p-shadow:     0 2px 8px rgba(0,0,0,.06);
  --p-shadow-md:  0 4px 16px rgba(0,0,0,.08);
}

/* ════════ BASE ════════ */
.antique-user-panel,
.antique-expert-panel,
.antique-user-panel *,
.antique-expert-panel * {
  font-family: 'Vazirmatn', 'IRANYekan', Tahoma, sans-serif !important;
  box-sizing: border-box;
}
.antique-user-panel,
.antique-expert-panel { direction: rtl; }

/* ════════ LAYOUT WRAPPER ════════ */
.ap-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: 100vh;
  background: var(--p-surface);
  direction: rtl;
}

/* ════════ SIDEBAR ════════ */
.ap-sidebar {
  background: #fff;
  border-left: 1px solid var(--p-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.ap-sidebar-head {
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--p-border-l);
}
.ap-sidebar-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--p-blue-l);
  color: var(--p-blue-d);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  margin-bottom: 10px;
  border: 2px solid var(--p-blue-l);
  overflow: hidden;
}
.ap-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.antique-expert-panel .ap-sidebar-avatar {
  background: var(--p-green-l); color: var(--p-green-d);
  border-color: var(--p-green-l);
}
.ap-sidebar-name { font-size: 14px; font-weight: 700; color: var(--p-title); margin: 0 0 2px; }
.ap-sidebar-role { font-size: 12px; color: var(--p-muted); }
.ap-sidebar-role span {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--p-blue-xl); color: var(--p-blue);
}
.antique-expert-panel .ap-sidebar-role span {
  background: var(--p-green-xl); color: var(--p-green);
}
.ap-nav { flex: 1; padding: 8px 10px; }
.ap-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--p-radius-sm);
  font-size: 13px; font-weight: 600; color: var(--p-text);
  cursor: pointer; border: none; background: none; width: 100%;
  text-align: right; transition: all .18s; text-decoration: none;
  margin-bottom: 2px;
}
.ap-nav-item:hover { background: var(--p-blue-xl); color: var(--p-blue); }
.ap-nav-item.active { background: var(--p-blue-xl); color: var(--p-blue); font-weight: 700; }
.antique-expert-panel .ap-nav-item:hover { background: var(--p-green-xl); color: var(--p-green); }
.antique-expert-panel .ap-nav-item.active { background: var(--p-green-xl); color: var(--p-green-d); font-weight: 800; border-right: 3px solid var(--p-green); }
.ap-nav-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.ap-nav-divider { height: 1px; background: var(--p-border-l); margin: 8px 4px; }
.ap-nav-logout {
  margin: 0 10px 16px; padding: 10px 12px;
  background: linear-gradient(135deg,#fee2e2,#fecaca); color: #b91c1c;
  border: 1.5px solid #fca5a5; border-radius: var(--p-radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer; width: calc(100% - 20px);
  text-align: center; transition: all .2s; text-decoration: none; display: block;
  box-shadow: 0 2px 6px rgba(220,38,38,.12);
}
.ap-nav-logout:hover { background: linear-gradient(135deg,#fecaca,#fca5a5); color: #991b1b; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(220,38,38,.2); }

/* ════════ MAIN CONTENT ════════ */
.ap-main { padding: 24px; min-width: 0; }
.ap-tab-content { display: none; animation: apFade .2s ease; }
.ap-tab-content.active { display: block; }
@keyframes apFade { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }

/* Page header */
.ap-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.ap-page-header h2 { font-size: 18px; font-weight: 800; color: var(--p-title); margin: 0; }
.ap-page-header p { font-size: 13px; color: var(--p-muted); margin: 3px 0 0; }

/* ════════ STAT CARDS ════════ */
.ap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.ap-stat-card {
  background: var(--p-card); border: 1px solid var(--p-border);
  border-radius: var(--p-radius); padding: 18px 16px;
  box-shadow: var(--p-shadow); display: flex; align-items: center; gap: 14px;
  transition: transform .18s, box-shadow .18s; cursor: default;
}
.ap-stat-card:hover { transform: translateY(-2px); box-shadow: var(--p-shadow-md); }
.ap-stat-icon { width: 44px; height: 44px; border-radius: var(--p-radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.ap-stat-icon.blue   { background: var(--p-blue-xl); }
.ap-stat-icon.green  { background: var(--p-green-xl); }
.ap-stat-icon.amber  { background: #fffbeb; }
.ap-stat-icon.red    { background: #fff5f5; }
.ap-stat-num { font-size: 26px; font-weight: 800; color: var(--p-title); line-height: 1; margin-bottom: 2px; }
.ap-stat-lbl { font-size: 12px; color: var(--p-muted); font-weight: 600; }

/* ════════ CARDS ════════ */
.ap-card {
  background: var(--p-card); border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg); padding: 20px;
  box-shadow: var(--p-shadow); margin-bottom: 18px;
}
.ap-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--p-border-l);
}
.ap-card-title { font-size: 14px; font-weight: 700; color: var(--p-title); display: flex; align-items: center; gap: 7px; }
.ap-card-title .icon { font-size: 17px; }

/* ════════ PROFILE CARD ════════ */
.ap-profile-hero {
  background: linear-gradient(135deg, var(--p-blue-d), var(--p-blue));
  border-radius: var(--p-radius-lg); padding: 24px; margin-bottom: 18px;
  color: #fff; display: flex; align-items: center; gap: 18px;
  position: relative; overflow: hidden;
}
.ap-profile-hero::before {
  content: '🏺'; position: absolute; left: -10px; bottom: -20px;
  font-size: 120px; opacity: .07; pointer-events: none;
}
.antique-expert-panel .ap-profile-hero {
  background: linear-gradient(135deg, var(--p-green-d), var(--p-green));
}
.ap-profile-avatar-lg {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff; overflow: hidden;
}
.ap-profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.ap-profile-hero-info h3 { font-size: 18px; font-weight: 800; margin: 0 0 4px; color: #fff; }
.ap-profile-hero-info p { font-size: 13px; opacity: .85; margin: 0; color: #fff; }
.ap-profile-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; margin-top: 6px;
  background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3);
}

/* Profile info grid */
.ap-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.ap-info-item {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: var(--p-radius); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.ap-info-item .ap-info-icon { font-size: 18px; flex-shrink: 0; }
.ap-info-item .ap-info-label { font-size: 11.5px; color: var(--p-muted); font-weight: 600; margin-bottom: 2px; }
.ap-info-item .ap-info-value { font-size: 13.5px; font-weight: 700; color: var(--p-title); }

/* ════════ FORM ════════ */
.ap-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ap-form-group { margin-bottom: 14px; }
.ap-form-group label { display: block; font-size: 12.5px; font-weight: 700; color: var(--p-text); margin-bottom: 5px; }
.ap-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--p-border);
  border-radius: var(--p-radius-sm); font-size: 13px; color: var(--p-title);
  background: #fafafa; transition: border .2s, box-shadow .2s; outline: none;
}
.ap-input:focus {
  border-color: var(--p-blue); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.antique-expert-panel .ap-input:focus {
  border-color: var(--p-green);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
.ap-pw-wrap { position: relative; }
.ap-pw-wrap .ap-input { padding-left: 38px; }
.ap-pw-eye { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #9ca3af; font-size: 16px; padding: 0; }
.ap-pw-eye:hover { color: var(--p-blue); }
.ap-btn-primary {
  padding: 10px 22px; background: linear-gradient(135deg,var(--p-blue),var(--p-blue-d));
  color: #fff; border: none; border-radius: var(--p-radius-sm); font-size: 13.5px;
  font-weight: 700; cursor: pointer; transition: all .25s;
}
.ap-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.3); }
.antique-expert-panel .ap-btn-primary { background: linear-gradient(135deg,var(--p-green),var(--p-green-d)); }
.antique-expert-panel .ap-btn-primary:hover { box-shadow: 0 6px 18px rgba(5,150,105,.3); }
.ap-btn-secondary {
  padding: 10px 18px; background: #fff; color: var(--p-text);
  border: 1.5px solid var(--p-border); border-radius: var(--p-radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.ap-btn-secondary:hover { background: var(--p-surface); border-color: #9ca3af; }

/* ════════ TABLES ════════ */
.ap-table-wrap { overflow-x: auto; border-radius: var(--p-radius); border: 1px solid var(--p-border); }
.ap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ap-table th { background: var(--p-surface); padding: 11px 14px; text-align: right; font-weight: 700; color: var(--p-text); border-bottom: 2px solid var(--p-border); white-space: nowrap; }
.ap-table td { padding: 11px 14px; border-bottom: 1px solid var(--p-border-l); color: var(--p-text); vertical-align: middle; }
.ap-table tr:last-child td { border-bottom: none; }
.ap-table tr:hover td { background: var(--p-surface); }
.ap-table .ap-row-action { display: flex; gap: 6px; align-items: center; }

/* ════════ BADGES ════════ */
.ap-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ap-badge-blue   { background: var(--p-blue-xl); color: var(--p-blue); }
.ap-badge-green  { background: var(--p-green-xl); color: var(--p-green); }
.ap-badge-amber  { background: #fffbeb; color: var(--p-amber); }
.ap-badge-red    { background: #fff5f5; color: var(--p-red); }
.ap-badge-gray   { background: var(--p-surface); color: var(--p-muted); border: 1px solid var(--p-border); }

/* Status → badge mapping */
.status-pending    { background: #fffbeb; color: #92400e; }
.status-assigned   { background: var(--p-blue-xl); color: var(--p-blue); }
.status-completed,
.status-delivered,
.status-expert_opinion { background: var(--p-green-xl); color: var(--p-green-d); }
.status-rejected   { background: #fff5f5; color: var(--p-red); }
.status-verified   { background: var(--p-green-xl); color: var(--p-green-d); }
.status-needs_fix  { background: #fffbeb; color: #92400e; }

/* ════════ ALERTS ════════ */
.ap-notice { padding: 12px 16px; border-radius: var(--p-radius); font-size: 13.5px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.ap-notice-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ap-notice-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.ap-notice-info    { background: var(--p-blue-xl); border: 1px solid var(--p-blue-l); color: var(--p-blue-d); }
.ap-notice-success { background: var(--p-green-xl); border: 1px solid var(--p-green-l); color: var(--p-green-d); }
.ap-notice-error   { background: #fff5f5; border: 1px solid #fecaca; color: var(--p-red); }

/* ════════ MOBILE TOPBAR (replaces sidebar on mobile) ════════ */
.ap-mobile-bar {
  display: none; background: #fff; border-bottom: 1px solid var(--p-border);
  padding: 12px 16px; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ap-mobile-bar .ap-mobile-logo { font-size: 15px; font-weight: 800; color: var(--p-title); }
.ap-mobile-menu-btn { background: none; border: none; font-size: 22px; cursor: pointer; }

/* ════════ ADMIN PROFILE CARD (in experts-page.php) ════════ */
.aq-expert-profile-card {
  background: #fff; border: 1px solid var(--p-border); border-radius: var(--p-radius-lg);
  overflow: hidden; box-shadow: var(--p-shadow); margin-bottom: 16px;
}
.aq-expert-profile-card .card-top {
  background: linear-gradient(135deg,#064e3b,#065f46);
  padding: 20px 20px 30px; position: relative;
}
.aq-expert-profile-card .card-avatar {
  width: 70px; height: 70px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff; overflow: hidden;
}
.aq-expert-profile-card .card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aq-expert-profile-card .card-name { font-size: 17px; font-weight: 800; color: #fff; margin: 8px 0 2px; }
.aq-expert-profile-card .card-meta { font-size: 12.5px; color: rgba(255,255,255,.8); }
.aq-expert-profile-card .card-body { padding: 16px 20px; margin-top: -10px; }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 820px) {
  .ap-layout { grid-template-columns: 1fr; }
  .ap-sidebar { display: none; height: auto; position: static; border: none; border-bottom: 1px solid var(--p-border); }
  .ap-sidebar.open { display: flex; }
  .ap-mobile-bar { display: flex; }
  .ap-main { padding: 16px; }
  .ap-form-row { grid-template-columns: 1fr; gap: 0; }
  .ap-stats { grid-template-columns: repeat(2, 1fr); }
  .ap-info-grid { grid-template-columns: 1fr; }
  .ap-profile-hero { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .ap-stats { grid-template-columns: 1fr; }
  .ap-profile-avatar-lg { width: 64px; height: 64px; font-size: 22px; }
}

/* Expert/Green OTP send button */
.antique-expert-panel .vt-send-btn,
.vt-send-btn.green {
  border-color: var(--p-green) !important;
  color: var(--p-green) !important;
}
.antique-expert-panel .vt-send-btn:hover,
.vt-send-btn.green:hover {
  background: var(--p-green) !important;
  color: #fff !important;
}
/* Expert panel primary button */
.antique-expert-panel .ap-btn-primary,
.vt-btn-green {
  background: linear-gradient(135deg, var(--p-green), var(--p-green-d)) !important;
}
.antique-expert-panel .ap-btn-primary:hover,
.vt-btn-green:hover {
  box-shadow: 0 8px 20px rgba(5,150,105,.35) !important;
}
