/* Shared dashboard chrome. Keep the header independent of uploaded logo sizes. */
.dashboard-shell { background: var(--bs-tertiary-bg, #f5f7f9); }
.dashboard-shell h1,.dashboard-shell h2,.dashboard-shell h3,.dashboard-shell h4,.dashboard-shell h5,.dashboard-shell h6 { font-family: "IRANYekanX", sans-serif !important; letter-spacing: normal; }
.app-header { border-bottom: 1px solid var(--bs-border-color); box-shadow: 0 1px 8px #142c3f05; }
.shell-bar { min-height: 60px; max-width: 1440px; margin: auto; padding: 8px 24px; display: flex; align-items: center; gap: 24px; }
.shell-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; color: var(--bs-body-color); }
.shell-brand img { display: block; width: auto; max-width: 104px; height: 32px; object-fit: contain; }
.shell-mark { background: var(--bs-primary); color: #fff; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-size: 18px; font-weight: 700; }
.shell-nav { display: flex; align-items: center; gap: 4px; }
.shell-nav-item { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--bs-secondary-color); border-radius: 8px; text-decoration: none; transition: background .16s, color .16s; }
.shell-nav-icon { flex: none; }
.shell-nav-item:hover { color: var(--bs-body-color); background: rgba(var(--bs-primary-rgb), .06); }
.shell-nav-item.is-active { color: color-mix(in srgb, var(--bs-primary) 85%, var(--bs-body-color)); background: rgba(var(--bs-primary-rgb), .1); }
.shell-nav-badge { min-width: 18px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 9px; font-size: 10.5px; font-style: normal; font-weight: 700; line-height: 1; background: rgba(245, 158, 11, .18); color: #b45309; }
[data-bs-theme=dark] .shell-nav-badge { color: #fbbf24; }
.shell-nav-item.is-active .shell-nav-badge { background: rgba(var(--bs-primary-rgb), .18); color: inherit; }
.shell-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; min-width: 0; }
.app-header .shell-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; padding: 0; background: transparent; border: 0; color: var(--bs-secondary-color); border-radius: 8px; text-decoration: none; }
.app-header .shell-icon:hover,.app-header .shell-account:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.app-header .shell-account { display: flex; gap: 8px; align-items: center; border: 1px solid var(--bs-border-color); border-radius: 8px; background: var(--bs-body-bg); padding: 7px 10px; min-height: 36px; font-size: 12px; color: var(--bs-body-color); }
.shell-account span { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header .dropdown-menu { border-radius: 12px !important; border: 1px solid var(--bs-border-color); padding: 6px !important; min-width: 180px; box-shadow: 0 8px 30px #13283a12 !important; }
.app-header .dropdown-item { font-size: 13px; padding: 9px 12px; border-radius: 6px !important; }
.app-header .dropdown-item svg { width: 18px; height: 18px; }
.dashboard-shell a:focus-visible,.dashboard-shell button:focus-visible,.dashboard-shell summary:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 3px; }
.dashboard-home { max-width: 1240px; margin: auto; padding: 0 24px 32px; }
.dashboard-home .container { max-width: none; padding: 0; }
.dashboard-home .page-heading { padding: 28px 0 20px !important; }
.dashboard-home .page-search { max-width: 600px; margin: 0 auto 24px; position: relative; }
.dashboard-home .page-search .input-group { margin-bottom: 0 !important; }
.dashboard-home .page-search .form-control { min-height: 44px; padding: 10px 42px 10px 80px !important; font-size: 13px; border: 1px solid var(--bs-border-color); border-radius: 10px !important; background: var(--bs-body-bg); }
.dashboard-home .page-search .icon-search { width: 18px; height: 18px; right: 14px; }
.dashboard-home .page-search .icon-cmd { left: 12px; }
.dashboard-home .welcome-text h1 { font-size: 21px; line-height: 1.8; }
.dashboard-home .welcome-text p { font-size: 13px; color: var(--bs-secondary-color); }
.dashboard-home .weather-info { font-size: 12px; color: var(--bs-secondary-color); text-align: left; }
.dashboard-home .weather-info .fs-5 { font-size: 13px !important; }
.dashboard-home .page-modules ul { display: grid !important; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px !important; }
.dashboard-home .module-item { min-width: 0; width: auto; margin: 0; }
.dashboard-home .module-item[hidden] { display: none !important; }
.dashboard-home .module-item > a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 126px; padding: 16px 8px; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 12px; text-decoration: none; transition: border-color .18s, box-shadow .18s; }
.dashboard-home .module-item > a:hover { border-color: rgba(var(--bs-primary-rgb),.44); box-shadow: 0 4px 16px #142c3f08; }
.dashboard-home .module-item .module-box { padding: 0; background: transparent !important; color: var(--bs-primary); }
.dashboard-home .module-box > svg { width: 36px; height: 36px; }
.dashboard-home .module-item .module-title { font-size: 13px; font-weight: 500; margin: 0 !important; line-height: 1.7; }
.dashboard-home .bookmark-icon { display: none; }
.ticket-count { position: absolute; top: 9px; right: 9px; padding: 2px 7px; min-width: 22px; border-radius: 6px; background: color-mix(in srgb, var(--bs-primary) 16%, white); color: color-mix(in srgb, var(--bs-primary) 75%, black); font-size: 11px; font-weight: 700; pointer-events: none; }
@media (max-width: 900px) { .dashboard-home .page-modules ul { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 640px) {
  .shell-bar { min-height: 56px; padding: 8px 12px; gap: 10px; }
  .shell-brand img { max-width: 88px; height: 28px; }
  .shell-account span { max-width: 76px; }
  .shell-actions { gap: 3px; }
  .dashboard-home { padding: 0 14px 24px; }
  .dashboard-home .page-heading { padding-top: 20px !important; }
  .dashboard-home .page-search { margin-bottom: 18px; }
  .dashboard-home .welcome-text h1 { font-size: 18px; }
  .dashboard-home .page-modules ul { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px !important; }
  .dashboard-home .module-item > a { height: 106px; }
  .dashboard-home .module-box > svg { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .dashboard-home * { animation: none !important; transition: none !important; } }
/* li_animate items start at opacity:0 and only fade in via the animation removed above — without this they stay invisible
   for anyone with "reduce motion" turned on (e.g. Windows animation effects off). */
@media (prefers-reduced-motion: reduce) { .li_animate > li { opacity: 1 !important; animation: none !important; } }
@media(max-width:380px) {
  .shell-brand img { max-width:64px; }
  .app-header .shell-icon { width:32px; height:34px; }
  .shell-account span { max-width:60px; }
  .shell-actions > a { margin:0 !important; width:28px; }
}
[data-bs-theme=dark] .dashboard-shell {
  --bs-body-bg:#000000;
  --bs-body-color:#e2e8f0;
  --bs-secondary-color:#a1aebb;
  --bs-tertiary-bg:#000000;
  --bs-border-color:#242424;
}
.shell-brand img { background:#15222b; border-radius:6px; padding:4px 6px; }
.home-other { border-top:1px solid var(--bs-border-color); margin-top:20px; padding-top:16px; }
.home-other summary { cursor:pointer; font-size:14px; font-weight:600; }
.home-other summary span { font-size:11px; font-weight:400; color:var(--bs-secondary-color); margin-inline-start:8px; }
.dashboard-home .home-other .page-modules ul { grid-template-columns:repeat(2,minmax(0,220px)); }
/* Home Screen safe areas and full-page navigation feedback. */
html[data-bs-theme=dark] { background:#000; }
html[data-bs-theme=light] { background:#fff; }
.app-header { padding-top:env(safe-area-inset-top,0px); }
.shell-bar { padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); }
.offcanvas-header { padding-top:max(1rem,calc(env(safe-area-inset-top,0px) + .5rem)); }
.navigation-loader[hidden] { display:none !important; }
.navigation-loader { position:fixed; inset:0; z-index:2000; display:grid; place-items:center; background:rgba(255,255,255,.72); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); }
.navigation-spinner { width:40px; height:40px; border:3px solid rgba(var(--bs-primary-rgb),.2); border-top-color:var(--bs-primary); border-radius:50%; animation:navigation-spin .75s linear infinite; }
[data-bs-theme=dark] .navigation-loader { background:rgba(0,0,0,.75); }
@keyframes navigation-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .navigation-spinner { animation-duration:1.8s; } }
@media(display-mode:standalone) { .dashboard-home,.support-page,.finance { padding-bottom:max(24px,env(safe-area-inset-bottom)); } }

/* Revenue overview on the home page: reuse the finance cards, minus their page-level padding. */
.dashboard-home .home-overview.finance { max-width:none; padding:0 0 28px; }
.dashboard-home .home-overview .fin-section-head { margin-bottom:12px; }

/* Home module cards: the legacy hover/focus rule (styles.rtl.css) turns the icon white for its old colored
   card background. These cards are white now, so keep the icon and title visible in the primary color. */
.dashboard-home .page-modules .module-item:hover .module-box,
.dashboard-home .page-modules .module-item:focus-within .module-box { color: var(--bs-primary); background: transparent !important; }
.dashboard-home .page-modules .module-item:hover .module-title,
.dashboard-home .page-modules .module-item:focus-within .module-title { color: var(--bs-primary); font-weight: 500; }
.dashboard-home .module-item > a:hover,
.dashboard-home .module-item > a:focus-visible { background: color-mix(in srgb, var(--bs-primary) 6%, var(--bs-body-bg)); border-color: rgba(var(--bs-primary-rgb),.44); }
.dashboard-home .module-item > a:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }

/* Global search (Ctrl+K): spinner, then every section at once. */
.gs-panel { position:absolute; z-index:60; top:calc(100% + 8px); right:0; left:0; max-height:min(70vh,560px); overflow-y:auto; padding:6px; background:var(--bs-body-bg); border:1px solid var(--bs-border-color); border-radius:12px; box-shadow:0 18px 44px rgba(0,0,0,.22); }
.gs-panel[hidden] { display:none; }
.gs-loading { display:flex; align-items:center; gap:12px; padding:18px 14px; font-size:12px; color:var(--bs-secondary-color); }
.gs-spinner { width:18px; height:18px; flex:none; border-radius:50%; border:2px solid rgba(var(--bs-primary-rgb),.2); border-top-color:var(--bs-primary); animation:gs-spin .7s linear infinite; }
@keyframes gs-spin { to { transform:rotate(360deg); } }
.gs-section + .gs-section { margin-top:4px; border-top:1px solid var(--bs-border-color); padding-top:4px; }
.gs-head { display:flex; align-items:center; justify-content:space-between; padding:8px 10px 4px; font-size:11px; font-weight:700; color:var(--bs-primary); }
.gs-head em { font-style:normal; font-weight:500; color:var(--bs-secondary-color); }
.gs-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border-radius:8px; text-decoration:none; color:var(--bs-body-color); }
.gs-item.is-active,.gs-item:hover,.gs-item:focus-visible { background:rgba(var(--bs-primary-rgb),.1); outline:none; }
.gs-text { display:flex; flex-direction:column; min-width:0; }
.gs-text strong { font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gs-text small { font-size:11px; color:var(--bs-secondary-color); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gs-badge { flex:none; padding:2px 8px; border-radius:6px; font-size:10px; background:rgba(120,140,150,.14); color:var(--bs-secondary-color); }
.gs-none { padding:8px 12px 10px; font-size:12px; color:var(--bs-secondary-color); }
.gs-error { color:#dc5261; }
@media (prefers-reduced-motion:reduce) { .gs-spinner { animation-duration:1.6s; } }
.gs-more { justify-content:center; margin-top:2px; font-size:12px; font-weight:600; color:var(--bs-primary); border:1px dashed rgba(var(--bs-primary-rgb),.35); }
.gs-title { display:flex; align-items:center; gap:8px; }
.gs-icon { --gs-hue:var(--bs-primary); display:inline-grid; place-items:center; width:26px; height:26px; flex:none; border-radius:8px; color:var(--gs-hue); background:color-mix(in srgb, var(--gs-hue) 14%, transparent); }
.gs-k-users { --gs-hue:#3b82f6; }
.gs-k-invoices { --gs-hue:#16a34a; }
.gs-k-accounts { --gs-hue:#8b5cf6; }
.gs-k-clients { --gs-hue:#0ea5a4; }
.gs-k-tickets { --gs-hue:#f59e0b; }
.gs-head { color:var(--bs-body-color); }
.gs-head .gs-title > span:last-child { font-weight:700; }

/* Date at the top of the home page: opens the sales calendar. */
.dashboard-home .home-date { text-decoration:none; padding:8px 14px 8px 12px; border:1px solid transparent; border-radius:12px; transition:background .15s, border-color .15s; }
.dashboard-home .home-date:hover,.dashboard-home .home-date:focus-visible { background:color-mix(in srgb, var(--bs-primary) 8%, var(--bs-body-bg)); border-color:rgba(var(--bs-primary-rgb),.4); color:var(--bs-body-color); outline:none; }
.dashboard-home .home-date-icon { display:inline-grid; place-items:center; width:40px; height:40px; flex:none; border-radius:11px; color:var(--bs-primary); background:color-mix(in srgb, var(--bs-primary) 12%, transparent); }
.dashboard-home .home-date .fs-5 { color:var(--bs-body-color); font-weight:600; }
@media (prefers-reduced-motion: reduce) { .shell-nav-item { transition: none; } }

/* Phones and small tablets: the section menu is hidden until the menu button is tapped, then drops down over the page. */
.shell-menu-toggle { display: none !important; }
.shell-menu-close { display: none; }
@media (max-width: 900px) {
  .shell-menu-toggle { display: inline-flex !important; margin-inline-end: -4px; }
  .is-menu-open .shell-menu-open { display: none; }
  .is-menu-open .shell-menu-close { display: block; }
  .app-header { position: sticky; }
  .shell-nav { position: absolute; top: 100%; right: 0; left: 0; z-index: 40; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px 12px 12px; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color);
    visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  .is-menu-open .shell-nav { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity .18s ease, transform .18s ease; }
  .shell-nav-item { padding: 12px 12px; font-size: 14px; }
  .shell-nav-item .shell-nav-badge { margin-inline-start: auto; }
}
@media (prefers-reduced-motion: reduce) { .shell-nav { transition: none !important; } }

/* Ticket numbers: the badge expands on hover/focus into a per-status breakdown (header badge and home tile share it). */
.tk-badge { position: relative; cursor: default; }
.ticket-count.tk-badge { position: absolute; pointer-events: auto; } /* keep the tile corner placement; .tk-badge alone would make it relative */
.tk-pop { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 90; width: 252px; display: none; flex-direction: column; gap: 7px;
  padding: 13px 14px 12px; border-radius: 12px; background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color);
  box-shadow: 0 14px 34px rgba(0,0,0,.2); font-size: 12px; font-style: normal; font-weight: 500; line-height: 1.7; text-align: right; cursor: default; }
.tk-pop::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* keeps hover while the pointer crosses the gap */
.tk-badge:hover .tk-pop,.tk-badge:focus .tk-pop,.tk-badge:focus-within .tk-pop { display: flex; animation: tk-in .14s ease-out; }
@keyframes tk-in { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ticket-count .tk-pop { left: auto; right: 0; transform: none; }
.ticket-count:hover .tk-pop,.ticket-count:focus .tk-pop { animation-name: tk-in-edge; }
@keyframes tk-in-edge { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tk-pop-title { font-size: 12px; font-weight: 700; padding-bottom: 7px; border-bottom: 1px solid var(--bs-border-color); }
.tk-row,.tk-sum { display: flex; align-items: center; gap: 8px; }
.tk-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--bs-secondary-color); opacity: .6; }
.tk-row.tk-open i { background: #3b82f6; opacity: 1; }
.tk-row.tk-reply i { background: #f59e0b; opacity: 1; }
.tk-row.tk-answered i { background: #16a34a; }
.tk-row span,.tk-sum span { flex: 1; }
.tk-row em,.tk-sum em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 26px; text-align: left; }
.tk-sum { padding-top: 7px; margin-top: 1px; border-top: 1px solid var(--bs-border-color); font-weight: 600; }
.tk-pop small { font-size: 10.5px; line-height: 1.8; color: var(--bs-secondary-color); font-weight: 400; }
@media (max-width: 900px) { .shell-nav-badge .tk-pop { left: 0; transform: none; } }
@media (hover: none) { .tk-pop { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .tk-pop { animation: none !important; } }

/* Brand: the uploaded logo, or a lettered mark with the brand name. */
.shell-brand img.shell-logo.is-round { width:44px; height:44px; max-width:none; padding:0; border-radius:50%; object-fit:cover; background:#fff; box-shadow:0 0 0 2px rgba(46,160,67,.28), 0 4px 14px rgba(15,23,42,.14); }
[data-bs-theme=dark] .shell-brand img.shell-logo.is-round { background:#fff; padding:0; }
@media (max-width:576px) {
  .shell-brand img.shell-logo.is-round { width:38px; height:38px; }
}

/* Persian UI: switches turn on toward the right (Bootstrap RTL moves the knob left). */
[dir=rtl] .form-switch .form-check-input { background-position:left center; }
[dir=rtl] .form-switch .form-check-input:checked { background-position:right center; }
.shell-brand-name { font-weight:700; font-size:14px; max-width:130px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
@media (max-width:420px) { .shell-brand-name { max-width:84px; } }
