﻿/* ==========================================================================
   HelpDesk Theme Pro  —  فایل جدید
   مسیر: Plugins/FaraMind.Plugin.HelpDeskSystem/Content/css/helpdesk-theme.css
   باید «بعد از» Styles.css لود شود. Styles.css را دست نزنید.
   هویت رنگی: نارنجی (#FF6B00) + سبز (#10B981)
   ========================================================================== */

/* ---------- 1) توکن‌ها ---------- */
:root {
  --primary: #FF6B00;
  --primary-2: #FF9A3D;
  --primary-hover: #E05E00;
  --primary-light: #FFF1E6;
  --secondary: #10B981;
  --secondary-2: #34D399;
  --secondary-light: #E7F9F2;
  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --text-dark: #1E2430;
  --text-muted: #6B7280;
  --border: #ECE8E2;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(30, 36, 48, .05), 0 1px 3px rgba(30, 36, 48, .04);
  --shadow-md: 0 8px 24px -8px rgba(30, 36, 48, .14);
  --shadow-lg: 0 24px 48px -16px rgba(30, 36, 48, .22);
  --glow-orange: 0 8px 24px -6px rgba(255, 107, 0, .45);
  --glow-green: 0 8px 24px -6px rgba(16, 185, 129, .4);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --glass: rgba(255, 255, 255, .78);
}

[data-theme="dark"] {
  --primary-light: rgba(255, 107, 0, .14);
  --secondary-light: rgba(16, 185, 129, .14);
  --bg: #0F1217;
  --surface: #181C24;
  --surface-2: #1D222B;
  --text-dark: #E9ECF1;
  --text-muted: #98A2B3;
  --border: #2A303B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, .7);
  --glass: rgba(24, 28, 36, .78);
  color-scheme: dark;
}

/* ---------- 2) پایه و پس‌زمینه ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(900px 500px at 105% -10%, rgba(255, 107, 0, .10), transparent 60%), radial-gradient(800px 480px at -10% 110%, rgba(16, 185, 129, .10), transparent 60%), var(--bg);
  background-attachment: fixed;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

::selection {
  background: var(--primary);
  color: #fff;
}

h1, h2, h3, h4, h5, .page-title, .btn, th, .nav-brand, .stat-card .number {
  font-family: 'iransans-medium', 'iransans-light', sans-serif;
}

/* اسکرول‌بار ظریف */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 40%, transparent) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 99px;
}

  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
  }

/* حلقه فوکوس واضح برای کار طولانی با کیبورد */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- 3) ناوبار شیشه‌ای ---------- */
.navbar {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: 0 6px 20px -12px rgba(30, 36, 48, .25);
}

  .navbar::after { /* نوار نارنجی-سبز نازک زیر ناوبار */
    content: "";
    position: absolute;
    inset: auto 0 -1px 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary) 55%, transparent);
    opacity: .85;
    pointer-events: none;
  }

.nav-brand {
  letter-spacing: -.2px;
}

  .nav-brand i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-radius: 10px;
    box-shadow: var(--glow-orange);
  }

.nav-menu li {
  position: relative;
  border-radius: 10px;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}

  .nav-menu li i {
    transition: transform .3s var(--ease);
  }

  .nav-menu li:hover {
    transform: translateY(-1px);
  }

    .nav-menu li:hover i {
      transform: scale(1.18) rotate(-6deg);
      color: var(--primary);
    }

  .nav-menu li.active {
    background: linear-gradient(135deg, var(--primary-light), transparent);
    color: var(--primary);
  }

    .nav-menu li.active::after {
      content: "";
      position: absolute;
      left: 22%;
      right: 22%;
      bottom: 4px;
      height: 3px;
      border-radius: 99px;
      background: linear-gradient(90deg, var(--primary), var(--secondary));
      animation: hd-grow .35s var(--ease);
    }

@keyframes hd-grow {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.user-avatar {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform .3s var(--ease);
}

.user-area:hover .user-avatar {
  transform: scale(1.06) rotate(-4deg);
}

.user-dropdown, .notif-dropdown {
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: hd-pop .22s var(--ease);
  overflow: hidden;
}

  .user-dropdown a {
    transition: background .2s, padding-right .2s var(--ease);
  }

    .user-dropdown a:hover {
      background: var(--primary-light);
      color: var(--primary);
      padding-right: 16px;
    }

@keyframes hd-pop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* دکمهٔ تم (توسط helpdesk-ux.js ساخته می‌شود) */
.hd-theme-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all .3s var(--ease);
}

  .hd-theme-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(20deg) scale(1.06);
    box-shadow: var(--glow-orange);
  }

/* ---------- 4) ورود صفحات (انیمیشن) ---------- */
#content-area > * {
  animation: hd-fade-up .45s var(--ease) both;
}

  #content-area > *:nth-child(2) {
    animation-delay: .05s;
  }

  #content-area > *:nth-child(3) {
    animation-delay: .10s;
  }

  #content-area > *:nth-child(4) {
    animation-delay: .15s;
  }

  #content-area > *:nth-child(5) {
    animation-delay: .20s;
  }

@keyframes hd-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.page-title {
  position: relative;
  padding-right: 14px;
  font-size: 1.15rem;
}

/* اندازهٔ عنوان‌ها و نوشته‌های کارت‌های داشبورد */
.chart-grid .card-header h3 {
  font-size: 1rem;
}

.stats-grid .stat-card .info h3 {
  font-size: .78rem;
}

.stats-grid .stat-card .info .number {
  font-size: 1.5rem;
}

  .page-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 14%;
    bottom: 14%;
    width: 4px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
  }

/* ---------- 5) کارت‌ها ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), border-color .3s;
}

  .card:hover {
    box-shadow: var(--shadow-md);
  }

.card-header {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

/* کارت آمار */
.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius-lg);
  isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: hd-fade-up .5s var(--ease) both;
}

  .stat-card:nth-child(2) {
    animation-delay: .06s;
  }

  .stat-card:nth-child(3) {
    animation-delay: .12s;
  }

  .stat-card:nth-child(4) {
    animation-delay: .18s;
  }

  .stat-card::before { /* هالهٔ رنگی */
    content: "";
    position: absolute;
    z-index: -1;
    width: 140px;
    height: 140px;
    left: -40px;
    top: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%);
    transition: transform .5s var(--ease);
  }

  .stat-card.green::before,
  .stat-card:has(.icon-green)::before {
    background: radial-gradient(circle, color-mix(in srgb, var(--secondary) 24%, transparent), transparent 70%);
  }

  .stat-card::after { /* خط رنگی کنار */
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    right: 0;
    width: 4px;
    border-radius: 99px 0 0 99px;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
  }

  .stat-card:has(.icon-green)::after {
    background: linear-gradient(180deg, var(--secondary), var(--secondary-2));
  }

  .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md), var(--glow-orange);
  }

  .stat-card:has(.icon-green):hover {
    box-shadow: var(--shadow-md), var(--glow-green);
  }

  .stat-card:hover::before {
    transform: scale(1.5);
  }

  .stat-card .icon {
    border-radius: 16px;
    transition: transform .4s var(--ease);
  }

  .stat-card:hover .icon {
    transform: rotate(-10deg) scale(1.12);
  }

.icon-orange {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--glow-orange);
}

.icon-green {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-2));
  color: #fff;
  box-shadow: var(--glow-green);
}

.stat-card .info .number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}

/* بنر تبلیغاتی داشبورد */
.dashboard-promo {
  border-radius: 22px;
  background: radial-gradient(circle at 15% 120%, rgba(16, 185, 129, .55), transparent 45%), linear-gradient(105deg, #d95700 0%, #ff7a18 55%, #ffa04f 100%);
  background-size: 140% 140%;
  animation: hd-fade-up .6s var(--ease) both, hd-drift 12s ease-in-out infinite alternate;
}

@keyframes hd-drift {
  to {
    background-position: 100% 60%;
  }
}

.dashboard-promo-icon {
  backdrop-filter: blur(6px);
  animation: hd-float 4s ease-in-out infinite;
}

@keyframes hd-float {
  50% {
    transform: translateY(-6px) rotate(-4deg);
  }
}

.dashboard-promo-btn {
  border-radius: 12px;
  font-weight: 700;
  transition: transform .3s var(--ease), box-shadow .3s;
}

  .dashboard-promo-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px rgba(120, 45, 0, .3);
  }

/* ---------- 6) دکمه‌ها ---------- */
.btn {
  position: relative;
  overflow: hidden;
  border-radius: 11px;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .25s, border-color .25s, color .25s;
}

  .btn:hover {
    transform: translateY(-2px);
  }

  .btn:active {
    transform: translateY(0) scale(.97);
  }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 14px -4px rgba(255, 107, 0, .55);
}

  .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: var(--glow-orange);
  }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-2));
  box-shadow: 0 4px 14px -4px rgba(16, 185, 129, .5);
}

  .btn-secondary:hover {
    background: linear-gradient(135deg, #059669, var(--secondary));
    box-shadow: var(--glow-green);
  }

.btn-outline {
  background: var(--surface);
}

/* درخشش عبوری روی دکمه‌های اصلی */
.btn-primary::before, .btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg);
  transition: left .6s var(--ease);
}

.btn-primary:hover::before, .btn-secondary:hover::before {
  left: 130%;
}

/* Ripple (توسط ux.js) */
.hd-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  transform: scale(0);
  animation: hd-ripple .6s linear;
  pointer-events: none;
}

.btn-outline .hd-ripple {
  background: color-mix(in srgb, var(--primary) 25%, transparent);
}

@keyframes hd-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---------- 7) فرم‌ها ---------- */
.form-control {
  background: var(--surface);
  color: var(--text-dark);
  border-radius: 11px;
  border: 1.5px solid var(--border);
  transition: border-color .25s, box-shadow .25s, background .25s, transform .2s;
}

  .form-control:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  }

  .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 0, .14);
  }

  .form-control::placeholder {
    color: var(--text-muted);
    opacity: .7;
  }

.ticket-status-filter-menu {
  background: var(--surface);
  border-color: var(--border);
  border-radius: 12px;
  animation: hd-pop .2s var(--ease);
}

.ticket-status-filter-option {
  border-radius: 8px;
  transition: background .2s;
}

  .ticket-status-filter-option:hover {
    background: var(--primary-light);
  }

  .ticket-status-filter-option input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
  }

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--primary);
}

/* ---------- 8) جدول‌ها ---------- */
th {
  background: var(--surface-2);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  border-bottom-color: var(--border);
  transition: background .2s;
}

tbody tr {
  transition: transform .2s var(--ease), box-shadow .2s;
}

  tbody tr:hover td {
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  }

  tbody tr td:first-child {
    position: relative;
  }

  tbody tr:hover td:first-child::before {
    content: "";
    position: absolute;
    right: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
  }

.btn-link {
  color: var(--primary);
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-align: right;
}

  .btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline !important;
  }

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

/* ---------- 9) نشان‌ها (Badge) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: .38rem .7rem;
  border-radius: 99px;
  letter-spacing: 0;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .2);
}

.badge-status-open, .badge-status-inprogress, .badge-status-closed, .badge-status-pending {
  position: relative;
}

  .badge-status-open::before, .badge-status-inprogress::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: hd-pulse 1.8s ease-in-out infinite;
  }

@keyframes hd-pulse {
  0%,100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .4;
    transform: scale(1.5);
  }
}

/* ---------- 10) چت تیکت ---------- */
.chat-wrapper {
  background: radial-gradient(500px 220px at 90% 0%, rgba(255, 107, 0, .06), transparent 70%), radial-gradient(500px 220px at 10% 100%, rgba(16, 185, 129, .06), transparent 70%), var(--surface-2);
}

.msg-container {
  animation: hd-msg .4s var(--ease) both;
}

@keyframes hd-msg {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.msg-avatar {
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
  background: var(--border);
  color: var(--text-muted);
}

.agent-side .msg-avatar {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--glow-orange);
}

.customer-side .msg-avatar {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-2));
  color: #fff;
}

.msg-content {
  border-radius: 16px;
  transition: transform .2s var(--ease), box-shadow .2s;
}

  .msg-content:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }

.customer-side .msg-content {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-right-radius: 4px;
}

.agent-side .msg-content {
  background: linear-gradient(135deg, var(--primary-light), color-mix(in srgb, var(--primary-light) 40%, var(--surface)));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  border-bottom-left-radius: 4px;
}

.msg-content img {
  max-width: 100%;
  border-radius: 10px;
}

.msg-content pre, .msg-content code {
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 6px;
  direction: ltr;
  text-align: left;
}

.reply-area {
  background: var(--surface);
  border-top-color: var(--border);
}

.ticket-attachment, .ticket-selected-file {
  background: var(--surface-2);
  border-radius: 10px;
  transition: all .2s;
  color: var(--text-dark);
}

  .ticket-attachment:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
  }

.ticket-action-btn {
  border-radius: 12px;
}

.info-card {
  border-radius: var(--radius-lg);
}

.info-card-title {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

.info-icon {
  border-radius: 11px;
}

.info-item {
  transition: transform .2s var(--ease);
}

  .info-item:hover {
    transform: translateX(-3px);
  }

/* ---------- 11) ادیتور Quill ---------- */
.ql-toolbar.ql-snow, .ql-container.ql-snow {
  border-color: var(--border) !important;
  background: var(--surface);
}

.ql-toolbar.ql-snow {
  border-radius: 12px 12px 0 0;
  background: var(--surface-2);
}

.ql-container.ql-snow {
  border-radius: 0 0 12px 12px;
  transition: box-shadow .25s;
}

  .ql-container.ql-snow:focus-within {
    box-shadow: 0 0 0 4px rgba(255, 107, 0, .12);
  }

.ql-editor {
  color: var(--text-dark);
}

.ql-snow .ql-stroke {
  stroke: var(--text-muted);
}

.ql-snow .ql-fill {
  fill: var(--text-muted);
}

.ql-snow .ql-picker {
  color: var(--text-muted);
}

.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar .ql-active .ql-stroke {
  stroke: var(--primary) !important;
}

.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar .ql-active .ql-fill {
  fill: var(--primary) !important;
}

/* ---------- 12) مودال ---------- */
.modal-overlay {
  background: rgba(15, 18, 23, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal-content {
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  animation: hd-modal .35s var(--ease);
  border: 1px solid var(--border);
}

.modal-header {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

@keyframes hd-modal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 13) صفحه‌بندی ---------- */
.pagination-wrapper {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--text-muted);
  font-size: .85rem;
}

.page-btn {
  background: var(--surface);
  border-color: var(--border);
}

  .page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: var(--glow-orange);
  }

/* ---------- 14) تنظیمات / دانشنامه ---------- */
.settings-sidebar, .settings-content {
  border-radius: var(--radius-lg);
}

.settings-sidebar-header, .settings-panel-header {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

.settings-menu-item {
  border-radius: 12px;
}

  .settings-menu-item:hover {
    transform: translateX(-3px);
  }

  .settings-menu-item.active {
    background: linear-gradient(135deg, var(--primary-light), transparent);
    box-shadow: inset -3px 0 0 var(--primary);
  }

.kb-card {
  border-radius: 16px;
  background: var(--surface);
}

  .kb-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md), var(--glow-orange);
  }

.kb-cover img {
  transition: transform .6s var(--ease);
}

.kb-card:hover .kb-cover img {
  transform: scale(1.08);
}

/* ---------- 15) لودینگ و اسکلت ---------- */
.loading-overlay {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.loading-brand img {
  filter: drop-shadow(0 10px 20px rgba(255, 107, 0, .35));
}

.loading-brand::after {
  content: "";
  width: 120px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
  background-size: 200% 100%;
  animation: hd-bar 1.1s linear infinite;
}

@keyframes hd-bar {
  to {
    background-position: -200% 0;
  }
}

.hd-skeleton {
  background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 40%, var(--surface)) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: hd-shimmer 1.3s linear infinite;
  border-radius: 10px;
}

@keyframes hd-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- 16) Toast (جایگزین alert) ---------- */
.hd-toasts {
  position: fixed;
  top: 74px;
  left: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.hd-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-right: 4px solid var(--primary);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  line-height: 1.7;
  animation: hd-toast-in .4s var(--ease);
  position: relative;
  overflow: hidden;
}

  .hd-toast.out {
    animation: hd-toast-out .3s var(--ease) forwards;
  }

  .hd-toast i {
    font-size: 1.35rem;
    margin-top: 2px;
    color: var(--primary);
  }

  .hd-toast.success {
    border-right-color: var(--secondary);
  }

    .hd-toast.success i {
      color: var(--secondary);
    }

  .hd-toast.error {
    border-right-color: var(--danger);
  }

    .hd-toast.error i {
      color: var(--danger);
    }

  .hd-toast::after { /* نوار زمان */
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: .25;
    transform-origin: right;
    animation: hd-timer var(--hd-toast-ms, 4200ms) linear forwards;
  }

@keyframes hd-timer {
  to {
    transform: scaleX(0);
  }
}

@keyframes hd-toast-in {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(.95);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hd-toast-out {
  to {
    opacity: 0;
    transform: translateX(-30px) scale(.95);
  }
}

/* ---------- 17) نمودار دونات و لیست داشبورد (dashboard.js) ---------- */
.hd-greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

  .hd-greet h2 {
    font-size: 1.5rem;
    margin: 0;
  }

    .hd-greet h2 span {
      background: linear-gradient(90deg, var(--primary), var(--secondary));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

  .hd-greet p {
    color: var(--text-muted);
    font-size: .88rem;
    margin-top: 4px;
  }

.hd-quick {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hd-donut-wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 22px;
  flex-wrap: wrap;
}

.hd-donut {
  --size: 150px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
  transition: transform .5s var(--ease);
  animation: hd-spin-in 1s var(--ease) both;
}

  .hd-donut:hover {
    transform: scale(1.05) rotate(6deg);
  }

  .hd-donut::after {
    content: attr(data-total);
    position: absolute;
    inset: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    font-family: 'iransans-medium', sans-serif;
    font-size: 1.6rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .06);
  }

@keyframes hd-spin-in {
  from {
    transform: rotate(-120deg) scale(.6);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.hd-legend {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hd-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background .2s;
}

  .hd-legend-row:hover {
    background: var(--primary-light);
  }

.hd-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
}

.hd-legend-row strong {
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

.hd-recent {
  list-style: none;
}

  .hd-recent li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .2s, padding-right .25s var(--ease);
  }

    .hd-recent li:last-child {
      border-bottom: 0;
    }

    .hd-recent li:hover {
      background: var(--primary-light);
      padding-right: 28px;
    }

  .hd-recent .hd-r-ico {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--secondary-light);
    color: var(--secondary);
    flex: 0 0 auto;
  }

  .hd-recent .hd-r-sub {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

.hd-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- 18) حالت تیره: اصلاح رنگ‌های ثابت Styles.css ---------- */
[data-theme="dark"] .card-header,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .info-card-title,
[data-theme="dark"] .settings-sidebar-header,
[data-theme="dark"] .settings-panel-header,
[data-theme="dark"] .editor-toolbar,
[data-theme="dark"] .hd-action-bar,
[data-theme="dark"] th {
  background: var(--surface-2);
}

[data-theme="dark"] .chat-container,
[data-theme="dark"] .timelog-item {
  background: var(--surface-2);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .page-btn,
[data-theme="dark"] .editor-btn,
[data-theme="dark"] .ticket-emoji-picker,
[data-theme="dark"] .reply-area,
[data-theme="dark"] .hd-theme-btn {
  background: var(--surface);
  color: var(--text-dark);
}

[data-theme="dark"] .btn-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, .4);
}

  [data-theme="dark"] .btn-danger:hover {
    background: rgba(239, 68, 68, .12);
  }

[data-theme="dark"] .ticket-emoji-option:hover {
  background: var(--border);
}

[data-theme="dark"] .badge-light {
  background: var(--surface-2);
  color: var(--text-dark);
  border-color: var(--border);
}

[data-theme="dark"] .invoice-print-sheet {
  background: #fff;
  color: #222;
}
/* فاکتور همیشه سفید */
[data-theme="dark"] .auth-container {
  background: linear-gradient(135deg, #1a1208 0%, var(--bg) 100%);
}

[data-theme="dark"] .hd-donut::after {
  box-shadow: none;
}

[data-theme="dark"] .hd-bottom-nav,
[data-theme="dark"] .hd-sheet,
[data-theme="dark"] .hd-info-sheet,
[data-theme="dark"] .hd-reply-dock {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .hd-tool-btn, [data-theme="dark"] .hd-detail-tabs, [data-theme="dark"] .hd-filters-toggle {
  background: var(--surface);
  color: var(--text-dark);
  border-color: var(--border);
}

/* ---------- 19) موبایل: حس اپلیکیشن ---------- */
@media (max-width: 768px) {

  .navbar::after {
    opacity: .6;
  }

  .hd-greet h2 {
    font-size: 1.2rem;
  }

  .hd-quick {
    width: 100%;
  }

    .hd-quick .btn {
      flex: 1;
    }

  /* نوار پایین شیشه‌ای با نشانگر فعال */
  .hd-bottom-nav {
    background: var(--glass);
    -webkit-backdrop-filter: saturate(170%) blur(16px);
    backdrop-filter: saturate(170%) blur(16px);
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 -10px 30px -12px rgba(30, 36, 48, .22);
  }

    .hd-bottom-nav li {
      position: relative;
      transition: color .25s, transform .25s var(--ease);
    }

      .hd-bottom-nav li i {
        transition: transform .35s var(--ease);
      }

      .hd-bottom-nav li.active i {
        transform: translateY(-3px) scale(1.15);
        color: var(--primary);
        filter: drop-shadow(0 4px 8px rgba(255, 107, 0, .45));
      }

      .hd-bottom-nav li.active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 28%;
        right: 28%;
        height: 3px;
        border-radius: 0 0 99px 99px;
        background: linear-gradient(90deg, var(--primary), var(--secondary));
        animation: hd-grow .3s var(--ease);
      }

      .hd-bottom-nav li:active {
        transform: scale(.9);
      }

  /* دکمهٔ شناور «تیکت جدید» */
  .page-header > .btn-primary[onclick^="openAddTicket"] {
    position: fixed !important;
    z-index: 870;
    left: 16px;
    bottom: calc(var(--hd-nav-h, 64px) + 16px);
    width: auto !important;
    min-height: 52px;
    padding: 0 20px;
    border-radius: 99px;
    box-shadow: var(--glow-orange), 0 10px 24px rgba(0, 0, 0, .2);
    animation: hd-fab .5s var(--ease) .3s both;
  }

  @keyframes hd-fab {
    from {
      transform: scale(0) rotate(-90deg);
    }

    to {
      transform: none;
    }
  }

  .stat-card:hover {
    transform: none;
  }

  .stat-card:active {
    transform: scale(.97);
  }

  /* جدول‌ها به کارت: ظاهر بهتر */
  .table-responsive tr {
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 6px 0;
    animation: hd-fade-up .4s var(--ease) both;
  }

    .table-responsive tr:active {
      transform: scale(.985);
    }

  .table-responsive td {
    border-bottom: 1px dashed var(--border);
    padding: 9px 14px;
  }

    .table-responsive td:last-child {
      border-bottom: 0;
    }

    .table-responsive td::before {
      color: var(--text-muted);
    }

  .table-responsive tbody tr td:first-child::before {
    display: none;
  }

  tbody tr:hover td:first-child::before {
    content: none;
  }

  .hd-toasts {
    top: 64px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .hd-donut-wrap {
    justify-content: center;
    padding: 16px;
  }

  .hd-donut {
    --size: 130px;
  }

  .hd-recent li {
    padding: 12px 14px;
  }

  .modal-content {
    animation: hd-sheet .4s var(--ease);
    border-radius: 22px 22px 0 0;
  }

  @keyframes hd-sheet {
    from {
      transform: translateY(100%);
    }

    to {
      transform: none;
    }
  }

  /* پیام‌ها در چت: عرض بیشتر */
  .msg-box {
    max-width: calc(100% - 46px);
  }
}

/* ---------- 20) دسترس‌پذیری ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .navbar, .hd-bottom-nav, .hd-toasts, .hd-theme-btn {
    display: none !important;
  }

  body {
    background: #fff !important;
  }
}
