/* ==========================================================================
   PositionFinder - Workspace & Admin Dashboard Styles (RTL)
   ========================================================================== */

@font-face {
  font-family: 'iran';
  src: url("../../fonts/light.50c029d5af7e.woff") format('woff');
  font-display: swap;
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'iran';
  src: url("../../fonts/regular.5d6bb45f442a.woff") format('woff');
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'iran';
  src: url("../../fonts/medium.4a471769956e.woff") format('woff');
  font-display: swap;
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'iran';
  src: url("../../fonts/demibold.5012991719fb.woff") format('woff');
  font-display: swap;
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'iran';
  src: url("../../fonts/bold.8e724a4a15cc.woff") format('woff');
  font-display: swap;
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'iran';
  src: url("../../fonts/extrabold.db633a766fbb.woff") format('woff');
  font-display: swap;
  font-weight: 800;
  font-style: normal;
}

:root {
  --dash-bg: #f8fafc;
  --dash-card-bg: #ffffff;
  --dash-border: #e2e8f0;
  --dash-border-subtle: #f1f5f9;
  
  --dash-sidebar-bg: #0f172a;
  --dash-sidebar-hover: #1e293b;
  --dash-sidebar-active: #1e293b;
  --dash-sidebar-text: #94a3b8;
  --dash-sidebar-text-active: #38bdf8;
  --dash-sidebar-border: #1e293b;

  --dash-text-main: #0f172a;
  --dash-text-muted: #64748b;
  --dash-text-light: #94a3b8;

  --dash-primary: #2563eb;
  --dash-primary-hover: #1d4ed8;
  --dash-primary-light: #eff6ff;

  --dash-success: #10b981;
  --dash-success-light: #ecfdf5;

  --dash-warning: #f59e0b;
  --dash-warning-light: #fffbeb;

  --dash-danger: #ef4444;
  --dash-danger-light: #fef2f2;

  --dash-purple: #8b5cf6;
  --dash-purple-light: #f5f3ff;

  --dash-cyan: #06b6d4;
  --dash-cyan-light: #ecfeff;

  --dash-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --dash-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --dash-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  
  --sidebar-width: 270px;
  --header-height: 70px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'iran', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--dash-bg);
  color: var(--dash-text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
  font-family: inherit;
}

.pf-input,
.pf-select,
.pf-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--dash-text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pf-input:focus,
.pf-select:focus,
.pf-textarea:focus {
  outline: none;
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pf-textarea {
  resize: vertical;
  min-height: 92px;
}

.pf-file-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--dash-text-main);
  cursor: pointer;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */

.dash-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.dash-sidebar {
  width: var(--sidebar-width);
  background-color: var(--dash-sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 50;
  overflow-y: auto;
  border-left: 1px solid var(--dash-sidebar-border);
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sidebar-brand-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.sidebar-brand-text p {
  font-size: 0.75rem;
  color: #64748b;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.5px;
  padding: 12px 12px 6px 12px;
  margin-top: 8px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--dash-sidebar-text);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background-color: var(--dash-sidebar-hover);
  color: #f1f5f9;
}

.sidebar-item.active .sidebar-link {
  background: rgba(56, 189, 248, 0.1);
  color: var(--dash-sidebar-text-active);
  font-weight: 600;
}

.sidebar-item.active .sidebar-link svg {
  stroke: var(--dash-sidebar-text-active);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-right: auto;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-badge.badge-amber {
  background-color: #f59e0b;
  color: #fff;
}

.sidebar-badge.badge-blue {
  background-color: #2563eb;
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.sidebar-footer-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Main Area */
.dash-main {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Header */
.dash-header {
  height: var(--header-height);
  background-color: #fff;
  border-bottom: 1px solid var(--dash-border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--dash-text-main);
  border-radius: var(--radius-sm);
}

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dash-text-main);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-meta {
  text-align: right;
}

.user-meta .name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dash-text-main);
}

.user-meta .role {
  font-size: 0.72rem;
  color: var(--dash-text-muted);
}

/* Content Area */
.dash-content {
  padding: 32px;
  flex: 1;
}

/* ==========================================================================
   Components: Cards, Stats & Metrics
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--dash-card-bg);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--dash-shadow);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--dash-text-muted);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.icon-amber { background: var(--dash-warning-light); color: var(--dash-warning); }
.icon-blue { background: var(--dash-primary-light); color: var(--dash-primary); }
.icon-red { background: var(--dash-danger-light); color: var(--dash-danger); }
.icon-green { background: var(--dash-success-light); color: var(--dash-success); }
.icon-purple { background: var(--dash-purple-light); color: var(--dash-purple); }
.icon-cyan { background: var(--dash-cyan-light); color: var(--dash-cyan); }

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--dash-text-main);
  line-height: 1.2;
  margin-bottom: 6px;
}

.stat-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--dash-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--dash-text-light);
}

.stat-footer a {
  color: var(--dash-primary);
  font-weight: 600;
}

.stat-footer a:hover {
  text-decoration: underline;
}

/* Main Cards */
.dash-card {
  background: var(--dash-card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2, .card-header h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--dash-text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

/* Status Breakdown Bars */
.status-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.breakdown-pill {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--dash-border);
  background: var(--dash-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-pill .pill-label {
  font-size: 0.78rem;
  color: var(--dash-text-muted);
}

.breakdown-pill .pill-count {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dash-text-main);
}

/* ==========================================================================
   Tables & Lists
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
}

.dash-table th {
  background-color: #f8fafc;
  color: var(--dash-text-muted);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--dash-border);
  white-space: nowrap;
}

.dash-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--dash-border);
  color: var(--dash-text-main);
  vertical-align: middle;
}

.dash-table tr:hover td {
  background-color: #f8fafc;
}

.dash-table tr.unread-row td {
  background-color: #f0fdf4;
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
}

.badge-warning { background: var(--dash-warning-light); color: #b45309; border: 1px solid #fde68a; }
.badge-info { background: var(--dash-primary-light); color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-success { background: var(--dash-success-light); color: #047857; border: 1px solid #a7f3d0; }
.badge-danger { background: var(--dash-danger-light); color: #b91c1c; border: 1px solid #fecaca; }
.badge-purple { background: var(--dash-purple-light); color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-cyan { background: var(--dash-cyan-light); color: #0e7490; border: 1px solid #a5f3fc; }
.badge-default { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--dash-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--dash-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background-color: #fff;
  border-color: var(--dash-border);
  color: var(--dash-text-main);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--dash-danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--dash-text-main);
  margin-bottom: 8px;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--dash-border);
  background-color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--dash-text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  font-size: 0.76rem;
  color: var(--dash-text-muted);
  margin-top: 5px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--dash-primary);
  cursor: pointer;
}

/* Detail Views */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--dash-border-subtle);
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dash-text-muted);
}

.detail-value {
  font-size: 0.94rem;
  color: var(--dash-text-main);
}

/* Filters bar */
.filter-bar {
  background: var(--dash-card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--dash-border);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-box input {
  padding-right: 36px;
}

.search-box svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--dash-text-light);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.page-item {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--dash-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dash-text-main);
  transition: all 0.2s;
}

.page-item:hover {
  background: #f8fafc;
}

.page-item.active {
  background: var(--dash-primary);
  color: #fff;
  border-color: var(--dash-primary);
}

/* Toast Messages */
.dash-messages {
  position: fixed;
  top: 85px;
  left: 32px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast-msg {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--dash-shadow-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

.toast-success { background: #10b981; color: #fff; }
.toast-error { background: #ef4444; color: #fff; }
.toast-info { background: #3b82f6; color: #fff; }

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Mobile responsive */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .dash-sidebar {
    transform: translateX(100%);
  }

  .dash-sidebar.open {
    transform: translateX(0);
  }

  .dash-main {
    margin-right: 0;
  }

  .mobile-toggle {
    display: block;
  }

  .dash-content {
    padding: 20px 16px;
  }

  .dash-header {
    padding: 0 16px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-group {
    width: 100%;
  }

  .search-box {
    min-width: 100%;
    width: 100%;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Table: hide less important columns on mobile */
  .dash-table th:nth-child(3),
  .dash-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 16px 14px;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .dash-content {
    padding: 14px 12px;
  }

  .header-user .user-meta {
    display: none;
  }
}

/* ============================================================
   Table column width utilities
   ============================================================ */

/* Explicit widths for common table patterns */
.dash-table .col-id   { width: 60px;  min-width: 60px; }
.dash-table .col-sm   { width: 100px; min-width: 80px; }
.dash-table .col-md   { width: 160px; min-width: 120px; }
.dash-table .col-lg   { width: 240px; min-width: 180px; }
.dash-table .col-auto { width: auto; }
.dash-table .col-actions { width: 180px; min-width: 160px; white-space: nowrap; }

/* Fix overflow for action cells */
.dash-table td .action-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

/* ============================================================
   Feature row styling (for package form)
   ============================================================ */

.feature-row {
  padding: 12px 16px;
  border: 1px solid var(--dash-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--dash-bg);
}

.feature-row:hover {
  border-color: var(--dash-primary);
  background: var(--dash-primary-light);
}

/* ============================================================
   FAQ row styling
   ============================================================ */

.faq-row {
  transition: border-color 0.2s;
}

.faq-row:hover {
  border-color: var(--dash-primary) !important;
}

