@font-face{font-family:Yekan;src:url('/fonts/yekan-regular.woff') format('woff'),url('/fonts/yekan-regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
:root{font-family:Yekan,Tahoma,Arial,sans-serif;color:#f5f9ff;background:#06152a;--blue:#2584ff;--blue2:#0b5fe8;--panel:rgba(5,28,58,.78);--panel2:rgba(9,42,82,.67);--line:rgba(117,178,255,.28);--muted:#bfd0e5}
*{box-sizing:border-box}html,body{min-height:100%}html{background:#06152a}body{position:relative;margin:0;overflow-x:hidden;background:#06152a;color:#f5f9ff}body,button,input{font-family:inherit}button,input{font:inherit}.hidden{display:none!important}
.page-backdrop{position:fixed;inset:0;z-index:0;background-color:#e9eef3;background-image:linear-gradient(105deg,rgba(3,18,38,.18),rgba(5,31,64,.38) 50%,rgba(3,18,38,.66)),url('/images/forklift-bg.jpg?v=3.1.0');background-position:center center;background-size:cover;background-repeat:no-repeat;pointer-events:none}
.page-backdrop:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(2,14,30,.08),rgba(3,20,42,.30));pointer-events:none}
.app-shell{position:relative;z-index:1;min-height:100vh;display:grid;place-items:center;padding:clamp(20px,4vw,56px)}
.auth-card,.dashboard{border:1px solid var(--line);background:linear-gradient(145deg,rgba(10,45,86,.79),rgba(3,20,43,.84));box-shadow:0 32px 110px rgba(0,10,28,.58),inset 0 1px 0 rgba(255,255,255,.10);backdrop-filter:blur(18px) saturate(145%);-webkit-backdrop-filter:blur(18px) saturate(145%)}
.auth-card{width:min(100%,520px);padding:clamp(28px,5vw,46px);border-radius:30px}.auth-brand{display:flex;align-items:center;gap:20px}.logo-frame{width:84px;height:84px;display:grid;place-items:center;flex:0 0 auto}.brand-logo{width:76px;height:76px;object-fit:contain;display:block}.brand-en{display:block;color:#72afff;font-family:Arial,sans-serif;font-size:.72rem;font-weight:800;letter-spacing:1.7px;direction:ltr;text-align:right}.auth-brand h1,.dashboard-brand h1{margin:4px 0 0;font-size:clamp(1.75rem,4vw,2.25rem)}.auth-brand p{margin:8px 0 0;color:var(--muted)}.auth-divider{height:1px;margin:28px 0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.22),transparent)}
label{display:block;margin-bottom:9px}.input-wrap{position:relative}.input-icon{position:absolute;right:17px;top:50%;transform:translateY(-50%);color:#68a9ff;font-family:Arial;font-weight:800}input{width:100%;height:60px;border:1px solid rgba(255,255,255,.18);border-radius:17px;padding:0 50px 0 18px;outline:none;background:rgba(255,255,255,.08);color:#fff;direction:ltr;text-align:center;font-size:1.2rem}input:focus{border-color:#3c94ff;box-shadow:0 0 0 4px rgba(23,120,255,.16)}input::placeholder{color:#8392a7}
.primary-button,.ghost-button{border:0;border-radius:16px;font-weight:800;cursor:pointer}.primary-button{width:100%;min-height:56px;margin-top:16px;display:flex;align-items:center;justify-content:center;gap:12px;padding:12px 20px;color:#fff;background:linear-gradient(135deg,#3593ff,#1467e8);box-shadow:0 16px 38px rgba(10,91,214,.32)}.primary-button:hover{filter:brightness(1.06);transform:translateY(-1px)}.form-message{min-height:24px;margin:8px 0 0;color:#ffb4b4}.auth-note{margin:18px 0 0;color:#afbed1;font-size:.84rem;line-height:2;text-align:center}
.dashboard{width:min(100%,1320px);padding:clamp(22px,3vw,38px);border-radius:34px}.dashboard-header{display:flex;justify-content:space-between;gap:24px;align-items:center;padding-bottom:24px;border-bottom:1px solid rgba(255,255,255,.12)}.dashboard-brand{display:flex;align-items:center;gap:16px}.logo-frame-small{width:70px;height:70px}.logo-frame-small .brand-logo{width:64px;height:64px}.header-actions{display:flex;align-items:center;gap:12px}.today-card,.ghost-button,.mini-stat{border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.065);backdrop-filter:blur(10px)}.today-card{padding:10px 16px;border-radius:15px}.today-card span{display:block;color:#9db4cf;font-size:.75rem}.today-card strong{display:block;margin-top:3px}.ghost-button{padding:13px 18px;color:#fff}.stats-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:22px 0}.mini-stat{border-radius:18px;padding:18px}.mini-stat span{display:block;color:#aebed1;font-size:.82rem}.mini-stat strong{display:block;margin-top:8px;font-size:1.45rem}.online-text{color:#49d39d}
.dashboard-grid{display:grid;grid-template-columns:minmax(330px,.85fr) minmax(0,1.35fr);gap:22px}.status-card,.recent-card{border:1px solid rgba(255,255,255,.13);border-radius:26px;background:rgba(7,36,72,.70);backdrop-filter:blur(16px);padding:clamp(22px,3vw,34px)}.status-card{min-height:430px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.status-head{display:flex;align-items:center;gap:10px}.live-dot{width:12px;height:12px;border-radius:50%;background:#3dd6a0;box-shadow:0 0 0 8px rgba(61,214,160,.12)}.extension-display span{display:block;color:#aebbd0;margin-top:36px}.extension-display strong{display:block;font-family:Arial;font-size:clamp(4.6rem,9vw,7.3rem);line-height:1;margin:14px 0}.status-card p{max-width:500px;color:#c3cfde;line-height:2}.connection-status{margin-top:16px;padding:10px 18px;border-radius:999px;background:rgba(255,255,255,.08);color:#d8e3f0}.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.section-title span{color:#6caeff}.section-title h2{margin:4px 0 0}.recent-count{padding:8px 12px;border-radius:999px;background:rgba(23,120,255,.12)}.empty-state{min-height:300px;display:grid;place-items:center;text-align:center;color:#9eb0c5}.empty-icon{font-size:2.4rem}.recent-list{display:grid;gap:10px}.recent-item{display:grid;grid-template-columns:1fr auto;align-items:center;gap:16px;padding:15px 16px;border-radius:16px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.08)}.recent-number{font-family:Arial;font-size:1.04rem;font-weight:700;direction:ltr;text-align:right}.recent-time,.recent-date{color:#9eb0c5;font-size:.8rem;margin-top:4px}.recent-meta{display:flex;align-items:flex-end;flex-direction:column;gap:5px}.recent-status{font-size:.82rem;font-weight:800}.recent-status.answered{color:#49d39d}.recent-status.missed{color:#ff6f7d}.recent-status.ringing{color:#69aaff}
.call-overlay{position:fixed;inset:0;z-index:30;display:grid;place-items:center;padding:20px;background:rgba(0,10,24,.52);backdrop-filter:blur(7px)}.call-popup{position:relative;width:min(100%,430px);padding:34px;border:1px solid rgba(255,255,255,.18);border-radius:28px;text-align:center;background:linear-gradient(145deg,rgba(20,58,96,.88),rgba(5,23,45,.92));box-shadow:0 30px 90px rgba(0,0,0,.45)}.popup-close{position:absolute;top:14px;left:16px;border:0;background:transparent;color:#fff;font-size:1.8rem;cursor:pointer}.call-pulse{width:74px;height:74px;margin:0 auto 14px;display:grid;place-items:center;border-radius:50%;background:rgba(23,120,255,.18);font-size:2rem}.incoming-label{color:#74b3ff}.call-popup h2{margin:8px 0 5px;font-family:Arial;font-size:2.2rem}.caller-name{color:#c7d3e1}.call-meta{margin-top:15px;color:#c7d3e1}
@media(max-width:900px){.dashboard-grid{grid-template-columns:1fr}.status-card{min-height:360px}.dashboard-header{align-items:flex-start}.header-actions{flex-direction:column;align-items:stretch}.stats-row{grid-template-columns:1fr 1fr}.stats-row .mini-stat:last-child{grid-column:1/-1}}
@media(max-width:600px){.page-backdrop{background-position:57% center;background-size:cover}.app-shell{padding:14px}.auth-card,.dashboard{border-radius:24px}.auth-card{padding:25px 20px}.auth-brand{gap:14px}.logo-frame{width:66px;height:66px}.brand-logo{width:58px;height:58px}.dashboard{padding:18px}.dashboard-header{flex-direction:column}.dashboard-brand h1{font-size:1.45rem}.header-actions{width:100%;flex-direction:row}.today-card{flex:1}.stats-row{grid-template-columns:1fr}.stats-row .mini-stat:last-child{grid-column:auto}.recent-item{grid-template-columns:1fr}.recent-meta{align-items:flex-start}.extension-display strong{font-size:5rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* V3.1: background reliability and stronger V2.2 blue palette */
body::before{content:"";position:fixed;inset:0;z-index:0;background:url('/images/forklift-bg.jpg?v=3.1.0') center center/cover no-repeat;pointer-events:none}
body::after{content:"";position:fixed;inset:0;z-index:0;background:linear-gradient(105deg,rgba(3,18,38,.22),rgba(5,31,64,.39) 52%,rgba(2,14,31,.66));pointer-events:none}
.page-backdrop{z-index:0!important}
.app-shell,.call-overlay{position:relative;z-index:2}
@media(max-width:600px){body::before{background-position:58% center}.auth-card{background:linear-gradient(145deg,rgba(10,45,86,.82),rgba(3,20,43,.87))}}

/* V3.2 — Incoming call popup: fixed above viewport, no blurred/darkened background */
.call-overlay,
#callOverlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  padding: 20px;
  overflow: hidden;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto;
}

.call-overlay.hidden,
#callOverlay.hidden {
  display: none !important;
}

.call-popup {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(145deg, rgba(12,55,105,.97), rgba(3,24,53,.98));
  box-shadow:
    0 28px 90px rgba(0,0,0,.60),
    0 0 0 4px rgba(37,132,255,.14);
  animation: incomingCallPopup .28s ease-out;
}

body.call-popup-open {
  overflow: hidden;
}

@keyframes incomingCallPopup {
  from {
    opacity: 0;
    transform: translateY(24px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .call-overlay,
  #callOverlay {
    align-items: flex-end;
    padding: 12px;
  }

  .call-popup {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 26px 22px;
    border-radius: 26px 26px 18px 18px;
  }
}

/* V4 — secure extension login */
#extensionForm label:not(:first-child) {
  display: block;
  margin-top: 16px;
}

#password {
  direction: ltr;
  text-align: left;
  letter-spacing: .04em;
}

#password::placeholder {
  direction: rtl;
  text-align: right;
  letter-spacing: normal;
}

/* V4.1 — customer information from Kara_DW */
.customer-card{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0 8px;text-align:right}.customer-card>div{padding:13px 14px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.07)}.customer-card span{display:block;color:#91a9c3;font-size:.76rem;margin-bottom:5px}.customer-card strong{display:block;color:#fff;font-size:1rem;line-height:1.7}.caller-name:empty{display:none}@media(max-width:480px){.customer-card{grid-template-columns:1fr}}

/* =========================================================
   V5 — Rahkaran customer profile
   ========================================================= */

.profile-open {
  overflow: hidden;
}

.profile-open-button {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 11px 18px;
  border: 1px solid rgba(133, 190, 255, .36);
  border-radius: 15px;
  color: #eaf4ff;
  background: rgba(46, 133, 235, .15);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.profile-open-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(46, 133, 235, .25);
  border-color: rgba(133, 190, 255, .62);
}

.profile-open-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.history-profile-button {
  margin-top: 4px;
  padding: 7px 10px;
  border: 1px solid rgba(95, 164, 255, .34);
  border-radius: 10px;
  color: #dcecff;
  background: rgba(26, 113, 223, .12);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.history-profile-button:hover:not(:disabled) {
  background: rgba(26, 113, 223, .24);
}

.history-profile-button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 10, 24, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-overlay.hidden {
  display: none !important;
}

.profile-panel {
  width: min(1600px, 100%);
  height: min(94dvh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(130, 188, 255, .28);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(8, 37, 76, .98), rgba(3, 18, 39, .99));
  box-shadow:
    0 32px 120px rgba(0, 0, 0, .64),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.profile-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  background: rgba(8, 41, 83, .88);
}

.profile-header-content {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.profile-customer-identity {
  display: grid;
  grid-template-columns:
    minmax(250px, 1.35fr)
    minmax(145px, .62fr)
    minmax(175px, .78fr)
    minmax(185px, .72fr);
  gap: 12px;
  margin-top: 18px;
}

.profile-identity-item {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 15px;
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.profile-identity-item span {
  display: block;
  margin-bottom: 5px;
  color: #8fb1d7;
  font-size: .75rem;
  font-weight: 700;
}

.profile-identity-item strong {
  display: block;
  overflow: hidden;
  color: #f7fbff;
  font-size: clamp(.95rem, 1.25vw, 1.08rem);
  font-weight: 850;
  line-height: 1.65;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-name {
  border-color: rgba(105, 171, 255, .28);
  background: linear-gradient(135deg, rgba(56, 139, 238, .16), rgba(255, 255, 255, .045));
}

.profile-identity-name strong {
  font-size: clamp(1.12rem, 1.75vw, 1.45rem);
  font-weight: 950;
}

.profile-identity-id strong,
.profile-identity-phone strong {
  direction: ltr;
  text-align: right;
  font-family: Arial, sans-serif;
  letter-spacing: .035em;
}

.profile-identity-id strong {
  color: #f7fbff;
  font-size: clamp(1rem, 1.35vw, 1.14rem);
}

.profile-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
  font-size: 1.7rem;
  cursor: pointer;
}

.profile-close:hover {
  background: rgba(255, 255, 255, .13);
}

.profile-status-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 22px 0;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 17px;
  background: rgba(255, 255, 255, .055);
}

.profile-status-card > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-weight: 900;
}

.profile-status-card strong {
  display: block;
}

.profile-status-card p {
  margin: 4px 0 0;
  color: #b7c5d7;
  line-height: 1.75;
}

.profile-status-card.loading > span {
  color: #dcecff;
  background: rgba(52, 143, 255, .20);
}

.profile-status-card.success {
  border-color: rgba(58, 211, 155, .28);
  background: rgba(43, 185, 132, .08);
}

.profile-status-card.success > span {
  color: #dffff3;
  background: rgba(58, 211, 155, .22);
}

.profile-status-card.warning {
  border-color: rgba(255, 190, 74, .32);
  background: rgba(255, 171, 44, .08);
}

.profile-status-card.warning > span {
  color: #fff4d9;
  background: rgba(255, 183, 67, .20);
}

.profile-status-card.error {
  border-color: rgba(255, 104, 118, .34);
  background: rgba(255, 82, 101, .08);
}

.profile-status-card.error > span {
  color: #ffe4e7;
  background: rgba(255, 82, 101, .22);
}

.profile-sort-tip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  margin: 10px 22px 0;
  padding: 7px 13px;
  border: 1px solid rgba(110, 174, 255, .16);
  border-radius: 11px;
  color: #9db8d5;
  background: rgba(73, 139, 224, .055);
  font-size: .78rem;
  line-height: 1.55;
}

.profile-sort-tip.hidden {
  display: none !important;
}

.profile-sort-tip span {
  color: #72b3ff;
  font-family: Arial, sans-serif;
  font-size: .92rem;
  font-weight: 900;
}

.profile-sort-tip p {
  margin: 0;
}

.profile-sections {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 28px;
  scrollbar-gutter: stable;
}

.profile-section {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 19px;
  background: rgba(255, 255, 255, .035);
}

.profile-section-header {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 0;
  color: #fff;
  background: rgba(10, 46, 91, .80);
  text-align: right;
  cursor: pointer;
}

.profile-section-header:hover {
  background: rgba(15, 59, 113, .88);
}

.profile-section-header h3 {
  margin: 0;
  font-size: 1.03rem;
}

.profile-section-header span:not(.section-arrow) {
  display: block;
  margin-top: 4px;
  color: #8fb1d7;
  font-size: .77rem;
}

.section-arrow {
  font-family: Arial, sans-serif;
  font-size: 1.45rem;
  transition: transform .18s ease;
}

.profile-section.open .section-arrow {
  transform: rotate(180deg);
}

.profile-section-body {
  display: none;
  padding: 14px;
}

.profile-section.open .profile-section-body {
  display: block;
}

.data-table-shell {
  width: 100%;
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(2, 16, 35, .46);
  scrollbar-gutter: stable both-edges;
}

.customer-data-table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  direction: rtl;
}

.customer-data-table th,
.customer-data-table td {
  max-width: 330px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .065);
  border-left: 1px solid rgba(255, 255, 255, .05);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.customer-data-table td {
  color: #e9f2fc;
  font-size: .84rem;
}

.customer-data-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0;
  background: #0c3a70;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12);
}

.table-sort-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 10px 13px;
  border: 0;
  color: #f5f9ff;
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button.active {
  background: rgba(89, 159, 255, .18);
}

.sort-indicator {
  color: #7eb8ff;
  font-family: Arial, sans-serif;
}

.customer-data-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, .025);
}

.customer-data-table tbody tr:nth-child(even) {
  background: rgba(69, 135, 211, .065);
}

.customer-data-table tbody tr {
  transition: background .16s ease, box-shadow .16s ease;
}

.customer-data-table tbody tr:hover {
  background: rgba(65, 147, 248, .17);
  box-shadow: inset 4px 0 0 rgba(89, 164, 255, .75);
}

.customer-data-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ستون‌های توضیحی بلند، مانند «شرح پیگیری» */
.customer-data-table th.long-text-column,
.customer-data-table td.long-text-column {
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  white-space: normal;
}

.long-text-content {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.long-text-content.expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.long-text-toggle {
  margin-top: 7px;
  padding: 3px 0;
  border: 0;
  color: #82baff;
  background: transparent;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.long-text-toggle:hover {
  color: #c4e0ff;
  text-decoration: underline;
}

@media (max-width: 700px) {
  .customer-data-table th.long-text-column,
  .customer-data-table td.long-text-column {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
  }
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.table-counter {
  color: #9eb2ca;
  font-size: .8rem;
}

.load-more-button {
  padding: 9px 13px;
  border: 1px solid rgba(79, 156, 255, .30);
  border-radius: 11px;
  color: #e7f2ff;
  background: rgba(27, 112, 219, .14);
  font-weight: 800;
  cursor: pointer;
}

.load-more-button:hover {
  background: rgba(27, 112, 219, .25);
}

.table-message {
  padding: 28px 20px;
  border: 1px dashed rgba(255, 255, 255, .13);
  border-radius: 14px;
  color: #aebed1;
  text-align: center;
  background: rgba(255, 255, 255, .025);
}

.table-message.warning {
  color: #ffe1a7;
  border-color: rgba(255, 190, 74, .25);
  background: rgba(255, 174, 45, .055);
}

@media (max-width: 900px) {
  .profile-overlay {
    padding: 8px;
  }

  .profile-panel {
    height: calc(100dvh - 16px);
    border-radius: 22px;
  }

  .profile-header {
    padding: 18px;
  }

  .profile-customer-identity {
    grid-template-columns: minmax(220px, 1.15fr) minmax(140px, .65fr);
  }

  .profile-identity-phone,
  .profile-identity-item:not(.profile-identity-name):not(.profile-identity-id) {
    grid-column: auto;
  }

  .profile-status-card,
  .profile-sort-tip {
    margin: 12px 12px 0;
  }

  .profile-sections {
    padding: 12px 12px 20px;
  }

  .data-table-shell {
    max-height: 330px;
  }
}

@media (max-width: 600px) {
  .profile-header {
    gap: 12px;
  }

  .profile-header h2 {
    font-size: 1.3rem;
  }

  .profile-customer-identity {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 14px;
  }

  .profile-identity-phone,
  .profile-identity-item:not(.profile-identity-name):not(.profile-identity-id) {
    grid-column: auto;
  }

  .profile-identity-item {
    padding: 11px 13px;
  }

  .profile-identity-item strong {
    white-space: normal;
  }

  .profile-status-card {
    align-items: flex-start;
    padding: 13px;
  }

  .profile-status-card p {
    font-size: .82rem;
  }

  .profile-sort-tip {
    justify-content: flex-start;
    font-size: .74rem;
  }

  .profile-section-header {
    min-height: 60px;
    padding: 12px 14px;
  }

  .profile-section-body {
    padding: 9px;
  }

  .customer-data-table th,
  .customer-data-table td {
    padding: 10px 12px;
    font-size: .79rem;
  }

  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .load-more-button {
    width: 100%;
  }
}

/* =========================================================
   V5.1.4 — compact mobile profile header / larger table area
   ========================================================= */
@media (max-width: 600px) {
  .profile-overlay {
    padding: 0;
  }

  .profile-panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .profile-header {
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px 8px;
  }

  .profile-header h2 {
    font-size: 1.06rem;
    line-height: 1.45;
  }

  .profile-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.35rem;
  }

  .profile-customer-identity {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .72fr);
    gap: 6px;
    margin-top: 8px;
  }

  .profile-identity-item,
  .profile-identity-phone,
  .profile-identity-item:not(.profile-identity-name):not(.profile-identity-id) {
    grid-column: auto;
    min-height: 51px;
    padding: 6px 9px;
    border-radius: 10px;
  }

  .profile-identity-item span {
    margin-bottom: 1px;
    font-size: .63rem;
    line-height: 1.35;
  }

  .profile-identity-item strong,
  .profile-identity-name strong,
  .profile-identity-id strong {
    overflow: hidden;
    font-size: .84rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-identity-name strong {
    font-size: .94rem;
  }

  .profile-identity-id strong,
  .profile-identity-phone strong {
    font-size: .82rem;
  }

  .profile-status-card {
    gap: 8px;
    margin: 6px 8px 0;
    padding: 8px 10px;
    border-radius: 11px;
  }

  .profile-status-card > span {
    width: 29px;
    height: 29px;
    font-size: .88rem;
  }

  .profile-status-card strong {
    font-size: .78rem;
  }

  .profile-status-card p {
    margin-top: 1px;
    font-size: .68rem;
    line-height: 1.5;
  }

  .profile-sort-tip {
    min-height: 27px;
    gap: 5px;
    margin: 5px 8px 0;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: .68rem;
    line-height: 1.4;
  }

  .profile-sort-tip span {
    font-size: .78rem;
  }

  .profile-sections {
    padding: 7px 8px 12px;
  }

  .profile-section {
    margin-bottom: 8px;
    border-radius: 13px;
  }

  .profile-section-header {
    min-height: 50px;
    padding: 9px 11px;
  }

  .profile-section-header h3 {
    font-size: .92rem;
  }

  .profile-section-header span:not(.section-arrow) {
    margin-top: 2px;
    font-size: .67rem;
  }

  .section-arrow {
    font-size: 1.18rem;
  }

  .profile-section-body {
    padding: 6px;
  }

  .data-table-shell {
    max-height: clamp(350px, 59dvh, 590px);
    border-radius: 10px;
  }

  .customer-data-table th,
  .customer-data-table td {
    padding: 9px 10px;
  }
}

@media (max-width: 380px) {
  .profile-customer-identity {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  }

  .profile-identity-item,
  .profile-identity-phone,
  .profile-identity-item:not(.profile-identity-name):not(.profile-identity-id) {
    min-height: 48px;
    padding: 5px 7px;
  }

  .profile-identity-item strong,
  .profile-identity-name strong,
  .profile-identity-id strong,
  .profile-identity-phone strong {
    font-size: .76rem;
  }
}


/* =========================================================
   V6 — CDR history loaded directly from Issabel
   ========================================================= */
.history-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.history-refresh-button,
.history-load-more {
  border: 1px solid rgba(117, 177, 248, .28);
  color: #eaf4ff;
  background: rgba(34, 119, 222, .13);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, opacity .18s ease;
}

.history-refresh-button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 12px;
  font-size: .78rem;
}

.history-refresh-button:hover:not(:disabled),
.history-load-more:hover:not(:disabled) {
  background: rgba(34, 119, 222, .24);
  border-color: rgba(117, 177, 248, .46);
}

.history-refresh-button:disabled {
  opacity: .52;
  cursor: wait;
}

.history-message {
  margin: -6px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  color: #aebed1;
  background: rgba(255, 255, 255, .035);
  font-size: .78rem;
  line-height: 1.8;
}

.history-message[data-state="loading"] {
  color: #9ecbff;
  border-color: rgba(83, 157, 243, .22);
}

.history-message[data-state="success"] {
  color: #a8d9c7;
  border-color: rgba(73, 211, 157, .18);
}

.history-message[data-state="error"] {
  color: #ffc0c7;
  border-color: rgba(255, 111, 125, .25);
  background: rgba(255, 111, 125, .06);
}

.recent-card {
  min-width: 0;
}

.recent-list {
  max-height: 630px;
  overflow-y: auto;
  padding-left: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(101, 165, 238, .55) rgba(255, 255, 255, .04);
}

.recent-list::-webkit-scrollbar {
  width: 8px;
}

.recent-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}

.recent-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(101, 165, 238, .5);
}

.recent-number-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.recent-direction {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 900;
}

.recent-item.incoming {
  border-color: rgba(69, 211, 154, .25);
  background: linear-gradient(135deg, rgba(44, 173, 120, .115), rgba(255, 255, 255, .035));
  box-shadow: inset -3px 0 0 rgba(69, 211, 154, .72);
}

.recent-item.outgoing {
  border-color: rgba(255, 100, 116, .25);
  background: linear-gradient(135deg, rgba(218, 70, 88, .12), rgba(255, 255, 255, .035));
  box-shadow: inset -3px 0 0 rgba(255, 100, 116, .72);
}

.recent-item.incoming:hover {
  border-color: rgba(69, 211, 154, .38);
  background: linear-gradient(135deg, rgba(44, 173, 120, .17), rgba(255, 255, 255, .05));
}

.recent-item.outgoing:hover {
  border-color: rgba(255, 100, 116, .38);
  background: linear-gradient(135deg, rgba(218, 70, 88, .18), rgba(255, 255, 255, .05));
}

.recent-direction.incoming {
  color: #92f0c5;
  border: 1px solid rgba(69, 211, 154, .25);
  background: rgba(44, 173, 120, .16);
}

.recent-direction.outgoing {
  color: #ffafb9;
  border: 1px solid rgba(255, 100, 116, .25);
  background: rgba(218, 70, 88, .17);
}

.recent-duration {
  margin-top: 5px;
  color: #8298b2;
  direction: rtl;
  font-size: .73rem;
}

.recent-status.busy {
  color: #ffbd72;
}

.recent-status.failed {
  color: #d6a7ff;
}

.history-load-more {
  width: 100%;
  min-height: 44px;
  margin-top: 13px;
  border-radius: 13px;
}

@media (max-width: 600px) {
  .section-title {
    align-items: flex-start;
    gap: 12px;
  }

  .history-header-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .history-refresh-button {
    min-height: 32px;
    padding: 5px 10px;
  }

  .recent-list {
    max-height: 70dvh;
  }

  .recent-item {
    gap: 11px;
  }

  .recent-meta {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}


/* =========================================================
   V6.0.3 — split incoming/outgoing counters
   ========================================================= */
.mini-stat-calls {
  min-width: 0;
}

.today-call-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.today-direction-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.today-direction-stat small {
  font-size: .72rem;
  font-weight: 800;
}

.today-direction-stat strong,
.mini-stat .today-direction-stat strong {
  display: inline;
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 1.1rem;
  line-height: 1;
  direction: ltr;
}

.today-direction-stat.incoming {
  color: #8fe8bd;
  border-color: rgba(69, 211, 154, .18);
  background: rgba(44, 173, 120, .085);
}

.today-direction-stat.outgoing {
  color: #ffabb6;
  border-color: rgba(255, 100, 116, .18);
  background: rgba(218, 70, 88, .085);
}

.history-direction-counts {
  display: flex;
  align-items: center;
  gap: 7px;
}

.history-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  white-space: nowrap;
}

.history-count-badge small {
  font-size: .7rem;
  font-weight: 800;
}

.history-count-badge strong {
  font-family: Arial, sans-serif;
  font-size: .95rem;
  line-height: 1;
  direction: ltr;
}

.history-count-badge.incoming {
  color: #91ecc2;
  border-color: rgba(69, 211, 154, .22);
  background: rgba(44, 173, 120, .11);
}

.history-count-badge.outgoing {
  color: #ffadb7;
  border-color: rgba(255, 100, 116, .22);
  background: rgba(218, 70, 88, .11);
}

.history-message.hidden {
  display: none;
}

@media (max-width: 700px) {
  .history-header-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  .history-direction-counts {
    flex: 1 1 auto;
  }
}

@media (max-width: 430px) {
  .today-direction-stat {
    padding: 7px 8px;
  }

  .history-direction-counts {
    width: 100%;
  }

  .history-count-badge {
    flex: 1;
    justify-content: center;
  }
}

/* =========================================================
   V7 — customer profile redesign and account summary
   ========================================================= */
.customer-card-three {
  grid-template-columns: 1fr 1fr;
}

.customer-card-three .customer-company-card {
  grid-column: 1 / -1;
  border-color: rgba(105, 171, 255, .28);
  background: linear-gradient(135deg, rgba(56, 139, 238, .16), rgba(255, 255, 255, .045));
}

.customer-card-three .customer-company-card strong {
  font-size: 1.08rem;
  font-weight: 900;
}

.profile-customer-identity {
  grid-template-columns:
    minmax(210px, 1.25fr)
    minmax(190px, 1fr)
    minmax(120px, .62fr)
    minmax(160px, .78fr)
    minmax(145px, .72fr)
    minmax(175px, .9fr);
  gap: 10px;
}

.profile-identity-company {
  border-color: rgba(105, 171, 255, .28);
  background: linear-gradient(135deg, rgba(56, 139, 238, .16), rgba(255, 255, 255, .045));
}

.profile-identity-company strong {
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  font-weight: 950;
}

.profile-identity-contact strong {
  font-weight: 900;
}

.profile-account-balance-card strong,
.profile-identity-phone strong {
  direction: ltr;
  text-align: right;
  font-family: Arial, sans-serif;
  letter-spacing: .02em;
}

.profile-account-balance-card strong {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: .35em;
  width: 100%;
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
}

/* عدد سمت راست و «ریال» بلافاصله در سمت چپ آن */
.profile-account-balance-card .account-balance-number,
.profile-account-balance-card .account-balance-unit {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.profile-account-balance-card .account-balance-number {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Arial, sans-serif;
}

.profile-account-balance-card .account-balance-unit {
  direction: rtl;
  unicode-bidi: isolate;
  font-family: Yekan, Tahoma, Arial, sans-serif;
}

.profile-identity-item.account-positive {
  border-color: rgba(58, 211, 155, .32);
  background: rgba(43, 185, 132, .09);
}

.profile-identity-item.account-positive strong {
  color: #9ff0cd;
}

.profile-identity-item.account-negative {
  border-color: rgba(255, 104, 118, .34);
  background: rgba(255, 82, 101, .085);
}

.profile-identity-item.account-negative strong {
  color: #ffb0b8;
}

.profile-identity-item.account-neutral {
  border-color: rgba(255, 190, 74, .25);
  background: rgba(255, 174, 45, .055);
}

.profile-identity-item.account-unavailable {
  opacity: .72;
}

.profile-alerts {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  margin: 8px 22px 0;
}

.profile-alerts.hidden {
  display: none !important;
}

.profile-alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 190, 74, .24);
  border-radius: 10px;
  color: #f4dba8;
  background: rgba(255, 174, 45, .05);
  font-size: .73rem;
  line-height: 1.5;
}

.profile-alert-item > span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff1cc;
  background: rgba(255, 183, 67, .18);
  font-family: Arial, sans-serif;
  font-weight: 900;
}

.profile-alert-item p {
  margin: 0;
}

.profile-sort-tip {
  min-height: 28px;
  margin-top: 7px;
  padding: 4px 10px;
  font-size: .71rem;
}

.sales-opportunity-summary {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.3fr)
    minmax(170px, 1fr)
    minmax(120px, .65fr)
    minmax(120px, .65fr)
    minmax(120px, .65fr);
  gap: 9px;
  margin-bottom: 15px;
  padding: 11px;
  border: 1px solid rgba(105, 171, 255, .17);
  border-radius: 14px;
  background: rgba(39, 105, 184, .055);
}

.sales-opportunity-summary > div {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.sales-opportunity-summary span {
  display: block;
  margin-bottom: 3px;
  color: #8fb1d7;
  font-size: .69rem;
  font-weight: 700;
}

.sales-opportunity-summary strong {
  display: block;
  overflow: hidden;
  color: #f4f9ff;
  font-size: .88rem;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-table-group + .opportunity-table-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.opportunity-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 3px;
}

.opportunity-table-title h4 {
  margin: 0;
  color: #f1f7ff;
  font-size: .92rem;
}

.opportunity-table-title span {
  color: #88a9ce;
  font-size: .72rem;
}

.profile-table-block .table-message {
  margin: 0;
}

@media (max-width: 1180px) {
  .profile-customer-identity {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sales-opportunity-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .customer-card-three {
    grid-template-columns: 1fr;
  }

  .customer-card-three .customer-company-card {
    grid-column: auto;
  }

  .profile-customer-identity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-identity-item,
  .profile-identity-phone,
  .profile-identity-item:not(.profile-identity-name):not(.profile-identity-id) {
    grid-column: auto;
  }

  .sales-opportunity-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
    padding: 7px;
  }

  .sales-opportunity-summary > div {
    padding: 6px 8px;
  }

  .profile-alerts {
    margin: 5px 8px 0;
  }
}

@media (max-width: 380px) {
  .profile-customer-identity,
  .sales-opportunity-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-identity-company strong {
    font-size: .84rem;
  }

  .profile-account-balance-card strong {
    font-size: .76rem !important;
  }
}


/* =========================================================
   V7.0.6 — preferred customer identity, critical debtor state,
   compact sales request table and responsive admissions cards
   ========================================================= */

/* وضعیت بدهکار باید بدون ابهام و با کنتراست بالا دیده شود. */
.profile-identity-item.account-debtor {
  border-color: rgba(255, 31, 58, .88) !important;
  background:
    linear-gradient(135deg, rgba(154, 0, 23, .38), rgba(255, 28, 57, .17)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 91, 109, .22),
    0 0 22px rgba(255, 20, 51, .16);
}

.profile-identity-item.account-debtor span,
.profile-identity-item.account-debtor strong,
.profile-identity-item.account-debtor .account-balance-number,
.profile-identity-item.account-debtor .account-balance-unit {
  color: #ff304d !important;
  font-weight: 950 !important;
  text-shadow: 0 0 12px rgba(255, 32, 68, .28);
}

.profile-identity-item.account-debtor strong {
  font-size: 1.02em;
}

/* درخواست فروش: عنوان‌های کوتاه، عرض کنترل‌شده و شکست متن برای جلوگیری
   از اسکرول افقی در نمایشگرهای معمول اداری. */
.profile-table-block[data-section="saleRequests"] .customer-data-table {
  min-width: 940px;
  table-layout: fixed;
}

.profile-table-block[data-section="saleRequests"] .customer-data-table th,
.profile-table-block[data-section="saleRequests"] .customer-data-table td {
  max-width: none;
  padding: 9px 7px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.profile-table-block[data-section="saleRequests"] .table-sort-button {
  min-height: 48px;
  padding: 7px 6px;
  gap: 4px;
  white-space: normal;
  line-height: 1.35;
  font-size: .75rem;
}

.profile-table-block[data-section="saleRequests"] th:nth-child(1) { width: 9%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(2) { width: 9%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(3) { width: 17%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(4) { width: 6%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(5) { width: 9%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(6) { width: 16%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(7) { width: 10%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(8) { width: 8%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(9) { width: 8%; }
.profile-table-block[data-section="saleRequests"] th:nth-child(10) { width: 8%; }

/* پذیرش: خلاصه‌ی قابل اسکن + جزئیات بازشونده؛ بدون جدول ۱۵ ستونه. */
.admissions-compact-block {
  min-width: 0;
}

.admissions-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admissions-toolbar label {
  display: grid;
  gap: 5px;
  color: #9eb6d2;
  font-size: .74rem;
  font-weight: 800;
}

.admissions-sort-select,
.admissions-sort-direction {
  min-height: 38px;
  border: 1px solid rgba(113, 172, 239, .23);
  border-radius: 10px;
  color: #eef6ff;
  background: rgba(8, 37, 72, .92);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
}

.admissions-sort-select {
  min-width: 165px;
  padding: 7px 10px;
}

.admissions-sort-direction {
  padding: 7px 12px;
  cursor: pointer;
}

.admissions-card-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1px 1px 2px;
  scrollbar-gutter: stable;
}

.admission-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(103, 169, 239, .16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(12, 54, 102, .54), rgba(4, 27, 55, .72));
}

.admission-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.admission-card-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.admission-card-title strong {
  color: #f4f9ff;
  font-size: .96rem;
  font-weight: 900;
}

.admission-card-title span {
  color: #94abc4;
  font-size: .76rem;
}

.admission-warranty-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(70, 213, 158, .2);
  border-radius: 999px;
  color: #a7efd2;
  background: rgba(42, 177, 126, .1);
  font-size: .72rem;
  font-weight: 900;
}

.admission-card-summary,
.admission-details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admission-detail-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}

.admission-detail-item span {
  display: block;
  margin-bottom: 4px;
  color: #829bb7;
  font-size: .68rem;
  font-weight: 800;
}

.admission-detail-item strong {
  display: block;
  min-width: 0;
  color: #edf5ff;
  font-size: .8rem;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admission-card-details {
  margin-top: 10px;
  border-top: 1px dashed rgba(123, 174, 231, .16);
}

.admission-card-details summary {
  width: max-content;
  max-width: 100%;
  padding-top: 10px;
  color: #85bcff;
  font-size: .76rem;
  font-weight: 900;
  cursor: pointer;
}

.admission-card-details[open] summary {
  color: #c5e0ff;
}

.admission-detail-wide {
  grid-column: 1 / -1;
}

@media (max-width: 1000px) {
  .profile-table-block[data-section="saleRequests"] .customer-data-table {
    min-width: 880px;
  }

  .admission-card-summary,
  .admission-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .admissions-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admissions-sort-select,
  .admissions-sort-direction {
    width: 100%;
  }

  .admission-card-header {
    align-items: flex-start;
  }

  .admission-card-summary,
  .admission-details-grid {
    grid-template-columns: 1fr;
  }

  .admission-detail-wide {
    grid-column: auto;
  }
}

/* =========================================================
   V7.1.0 — AI call summary
   ========================================================= */

.analysis-open {
  overflow: hidden;
}

.call-popup-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.call-popup-actions .profile-open-button,
.call-popup-actions .analysis-open-button {
  width: 100%;
  min-height: 52px;
  margin-top: 0;
}

.analysis-open-button {
  padding: 11px 18px;
  border: 1px solid rgba(94, 234, 190, .36);
  border-radius: 15px;
  color: #eafff8;
  background: rgba(31, 181, 136, .15);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.analysis-open-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(31, 181, 136, .25);
  border-color: rgba(94, 234, 190, .62);
}

.analysis-open-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.history-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.history-action-buttons .history-profile-button {
  margin-top: 0;
}

.history-analysis-button {
  padding: 7px 10px;
  border: 1px solid rgba(74, 220, 173, .34);
  border-radius: 10px;
  color: #ddfff4;
  background: rgba(23, 160, 118, .12);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.history-analysis-button:hover:not(:disabled) {
  background: rgba(23, 160, 118, .24);
}

.history-analysis-button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 10, 24, .78);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.analysis-overlay.hidden {
  display: none !important;
}

.analysis-panel {
  width: min(920px, 100%);
  max-height: min(92dvh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(103, 219, 184, .30);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(7, 42, 67, .99), rgba(3, 22, 39, .99));
  box-shadow: 0 32px 110px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.analysis-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  background: rgba(7, 55, 79, .86);
}

.analysis-kicker {
  display: block;
  margin-bottom: 4px;
  color: #72dfbc;
  font-size: .78rem;
  font-weight: 800;
}

.analysis-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.55rem;
}

.analysis-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  font-size: 1.55rem;
  cursor: pointer;
}

.analysis-close:hover {
  background: rgba(255, 255, 255, .12);
}

.analysis-content {
  overflow: auto;
  padding: 20px 22px 24px;
}

.analysis-status {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 15px;
  background: rgba(255, 255, 255, .045);
}

.analysis-status.hidden {
  display: none !important;
}

.analysis-status.loading {
  border-color: rgba(87, 163, 255, .28);
  background: rgba(36, 118, 217, .08);
}

.analysis-status.pending {
  border-color: rgba(255, 190, 74, .30);
  background: rgba(255, 174, 45, .07);
}

.analysis-status.error {
  border-color: rgba(255, 85, 105, .34);
  background: rgba(222, 44, 67, .09);
}

.analysis-status-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, .09);
  font-size: 1.15rem;
  font-weight: 900;
}

.analysis-status strong {
  display: block;
  margin-bottom: 5px;
  color: #fff;
}

.analysis-status p {
  margin: 0;
  color: #b9c9d8;
  line-height: 1.9;
}

.analysis-details.hidden {
  display: none !important;
}

.analysis-meta-grid {
  display: grid;
  grid-template-columns: minmax(140px, .55fr) minmax(220px, 1.45fr);
  gap: 10px;
  margin-bottom: 12px;
}

.analysis-meta-item {
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
}

.analysis-meta-item span {
  display: block;
  margin-bottom: 5px;
  color: #8fa7ba;
  font-size: .76rem;
}

.analysis-meta-item strong {
  display: block;
  color: #f6fbff;
  line-height: 1.8;
}

.analysis-card {
  margin-top: 12px;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}

.analysis-card h3 {
  margin: 0 0 9px;
  color: #fff;
  font-size: 1rem;
}

.analysis-card p {
  margin: 0;
  color: #d5e1ea;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.analysis-card-summary {
  border-color: rgba(92, 162, 255, .22);
}

.analysis-card-outcome {
  border-color: rgba(255, 192, 84, .22);
}

.analysis-card-recommendation {
  border-color: rgba(78, 224, 176, .26);
  background: rgba(26, 154, 115, .055);
}

.analysis-retry-button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid rgba(97, 218, 181, .32);
  border-radius: 13px;
  color: #e9fff8;
  background: rgba(26, 154, 115, .13);
  font-weight: 800;
  cursor: pointer;
}

.analysis-retry-button:hover:not(:disabled) {
  background: rgba(26, 154, 115, .24);
}

.analysis-retry-button:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 600px) {
  .call-popup-actions {
    grid-template-columns: 1fr;
  }

  .analysis-overlay {
    padding: 0;
  }

  .analysis-panel {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .analysis-header {
    padding: 16px;
  }

  .analysis-content {
    padding: 14px;
  }

  .analysis-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   V7.2.2 — Jalali date-range history for extension users
   ========================================================= */
.history-date-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) minmax(165px, .62fr);
  align-items: end;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(117, 177, 248, .14);
  border-radius: 16px;
  background: rgba(6, 25, 49, .46);
}

.history-date-filter label,
.history-date-filter-action {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-date-filter label > span {
  color: #b8c9da;
  font-size: .78rem;
  font-weight: 800;
}

.history-date-filter small {
  min-height: 17px;
  color: #8098b1;
  font-size: .7rem;
  line-height: 1.6;
}

.history-jalali-date-button {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid rgba(117, 177, 248, .22);
  border-radius: 12px;
  outline: none;
  color: #eef7ff;
  background: rgba(10, 37, 70, .72);
  text-align: right;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.history-jalali-date-button:hover,
.history-jalali-date-button:focus-visible {
  border-color: rgba(82, 166, 255, .75);
  box-shadow: 0 0 0 4px rgba(66, 147, 236, .11);
  background: rgba(13, 49, 89, .88);
}

.history-jalali-date-button strong {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: .92rem;
  letter-spacing: .02em;
}

.history-jalali-date-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #84c9ff;
  background: rgba(73, 157, 244, .14);
  font-family: Tahoma, Arial, sans-serif;
}

.history-date-submit {
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid rgba(73, 211, 157, .34);
  border-radius: 12px;
  color: #f4fffb;
  background: linear-gradient(135deg, rgba(30, 125, 210, .9), rgba(28, 168, 132, .92));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(5, 72, 112, .18);
  transition: transform .16s ease, filter .16s ease;
}

.history-date-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.history-message {
  margin: 0 0 14px;
}

.history-calendar-open {
  overflow: hidden;
}

.history-jalali-calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 11, 22, .74);
  backdrop-filter: blur(8px);
}

.history-jalali-calendar-panel {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid rgba(100, 173, 236, .28);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(15, 48, 81, .99), rgba(6, 25, 48, .99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
}

.history-jalali-calendar-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.history-jalali-calendar-header > div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.history-jalali-calendar-header span {
  color: #8fa6bd;
  font-size: .77rem;
}

.history-jalali-calendar-header strong {
  color: #fff;
  font-size: 1.15rem;
}

.history-jalali-calendar-header > button,
.history-jalali-calendar-footer button {
  border: 1px solid rgba(111, 179, 237, .24);
  color: #e9f6ff;
  background: rgba(30, 76, 116, .62);
  cursor: pointer;
}

.history-jalali-calendar-header > button {
  width: 44px;
  height: 42px;
  border-radius: 12px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 1.8rem;
  line-height: 1;
}

.history-jalali-calendar-header > button:hover,
.history-jalali-calendar-footer button:hover {
  border-color: rgba(73, 223, 210, .62);
  background: rgba(33, 106, 132, .72);
}

.history-jalali-weekdays,
.history-jalali-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.history-jalali-weekdays {
  margin-bottom: 7px;
  color: #8eabc3;
  text-align: center;
  font-size: .78rem;
}

.history-jalali-weekdays span:last-child {
  color: #ff8497;
}

.history-jalali-day-placeholder,
.history-jalali-day {
  aspect-ratio: 1;
  min-width: 0;
}

.history-jalali-day {
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #eef8ff;
  background: rgba(18, 53, 87, .54);
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.history-jalali-day:hover,
.history-jalali-day:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(74, 167, 255, .66);
  outline: none;
  background: rgba(33, 91, 137, .82);
}

.history-jalali-day.today {
  border-color: rgba(73, 223, 210, .62);
  color: #77f5e9;
}

.history-jalali-day.selected {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #198dd5, #18b6a2);
  box-shadow: 0 8px 18px rgba(19, 164, 177, .28);
}

.history-jalali-calendar-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.history-jalali-calendar-footer button {
  min-width: 96px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
}

@media (max-width: 760px) {
  .history-date-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-date-filter-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .history-date-filter {
    grid-template-columns: 1fr;
    padding: 11px;
  }

  .history-date-filter-action {
    grid-column: auto;
  }

  .history-jalali-calendar-overlay {
    padding: 10px;
  }

  .history-jalali-calendar-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .history-jalali-weekdays,
  .history-jalali-days {
    gap: 5px;
  }

  .history-jalali-day {
    border-radius: 10px;
  }
}

/* =========================================================
   V7.2.3 — Extension performance charts
   Native SVG/HTML charts; no external CDN dependency
   ========================================================= */
.status-card {
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
  gap: 24px;
  text-align: right;
}

.status-card-intro {
  display: grid;
  justify-items: center;
  text-align: center;
}

.status-card-intro .extension-display span {
  margin-top: 18px;
}

.status-card-intro .extension-display strong {
  font-size: clamp(4.2rem, 7vw, 6.3rem);
  margin: 10px 0;
}

.status-card-intro p {
  margin: 4px auto 0;
  font-size: .87rem;
  line-height: 1.9;
}

.status-card-intro .connection-status {
  margin-top: 12px;
}

.performance-card {
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(105, 175, 247, .18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 0%, rgba(42, 143, 233, .13), transparent 42%),
    rgba(3, 22, 45, .54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.performance-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.performance-card-header > div:first-child {
  min-width: 0;
}

.performance-card-header span {
  display: block;
  color: #6fb8ff;
  font-size: .72rem;
  font-weight: 800;
}

.performance-card-header h2 {
  margin: 3px 0 4px;
  color: #fff;
  font-size: 1.02rem;
}

.performance-card-header small {
  display: block;
  max-width: 220px;
  color: #8fa6bc;
  font-size: .68rem;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.performance-chart-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(113, 181, 242, .17);
  border-radius: 11px;
  background: rgba(3, 18, 37, .56);
}

.performance-chart-switch button {
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #8fa8bf;
  background: transparent;
  font-size: .69rem;
  font-weight: 900;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.performance-chart-switch button:hover,
.performance-chart-switch button:focus-visible {
  color: #fff;
  outline: none;
}

.performance-chart-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(32, 130, 219, .95), rgba(24, 177, 157, .88));
  box-shadow: 0 7px 16px rgba(12, 90, 143, .24);
}

.performance-chart-area {
  position: relative;
  min-height: 232px;
}

.performance-bar-chart {
  display: grid;
  gap: 11px;
  align-content: center;
  min-height: 232px;
}

.performance-bar-row {
  display: grid;
  grid-template-columns: minmax(82px, 112px) minmax(70px, 1fr) 28px;
  align-items: center;
  gap: 9px;
}

.performance-bar-label {
  color: #c4d3e1;
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.performance-bar-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .26);
}

.performance-bar-fill {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--performance-bar-width, 0%);
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #3c9cff, #60d8ff);
  box-shadow: 0 0 14px rgba(72, 170, 255, .28);
  transform-origin: right center;
  animation: performanceBarGrow .42s ease both;
}

.performance-bar-row.outgoing .performance-bar-fill {
  background: linear-gradient(90deg, #8a74ff, #c687ff);
}

.performance-bar-row.answered .performance-bar-fill {
  background: linear-gradient(90deg, #1dbf88, #55e7ad);
}

.performance-bar-row.missed .performance-bar-fill {
  background: linear-gradient(90deg, #f04c69, #ff8395);
}

.performance-bar-row.busy .performance-bar-fill {
  background: linear-gradient(90deg, #e99331, #ffc15a);
}

.performance-bar-row.failed .performance-bar-fill {
  background: linear-gradient(90deg, #ad5dde, #df91ff);
}

.performance-bar-row.ringing .performance-bar-fill {
  background: linear-gradient(90deg, #2d79ff, #56b4ff);
}

.performance-bar-value {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: .82rem;
  text-align: left;
  direction: ltr;
}

@keyframes performanceBarGrow {
  from { transform: scaleX(0); opacity: .35; }
  to { transform: scaleX(1); opacity: 1; }
}

.performance-donut-view {
  min-height: 232px;
  display: grid;
  grid-template-columns: minmax(140px, .9fr) minmax(120px, 1.1fr);
  align-items: center;
  gap: 15px;
}

.performance-donut-wrap {
  position: relative;
  width: min(100%, 176px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.performance-donut {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .22));
}

.performance-donut-background,
.performance-donut-segment {
  fill: none;
  stroke-width: 15;
}

.performance-donut-background {
  stroke: rgba(255, 255, 255, .065);
}

.performance-donut-segment {
  stroke-linecap: butt;
  animation: performanceDonutReveal .5s ease both;
}

.performance-donut-segment.answered { stroke: #46d69d; }
.performance-donut-segment.missed { stroke: #ff687d; }
.performance-donut-segment.busy { stroke: #f4a945; }
.performance-donut-segment.failed { stroke: #c879ee; }
.performance-donut-segment.ringing { stroke: #4f9dff; }

@keyframes performanceDonutReveal {
  from { opacity: .15; }
  to { opacity: 1; }
}

.performance-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  pointer-events: none;
}

.performance-donut-center strong {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.85rem;
  line-height: 1;
}

.performance-donut-center span {
  margin-top: 6px;
  color: #8fa7bd;
  font-size: .68rem;
}

.performance-donut-legend {
  display: grid;
  gap: 8px;
}

.performance-legend-item {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #c8d6e2;
  font-size: .7rem;
}

.performance-legend-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ea4b9;
  box-shadow: 0 0 0 4px rgba(142, 164, 185, .08);
}

.performance-legend-item.answered .performance-legend-marker { background: #46d69d; }
.performance-legend-item.missed .performance-legend-marker { background: #ff687d; }
.performance-legend-item.busy .performance-legend-marker { background: #f4a945; }
.performance-legend-item.failed .performance-legend-marker { background: #c879ee; }
.performance-legend-item.ringing .performance-legend-marker { background: #4f9dff; }

.performance-legend-item span:nth-child(2) {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.performance-legend-item strong {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: .78rem;
}

.performance-empty {
  min-height: 232px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(124, 176, 225, .18);
  border-radius: 15px;
  color: #8fa7bd;
  text-align: center;
  font-size: .78rem;
  line-height: 1.9;
}

.performance-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.performance-kpis article {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(111, 177, 235, .13);
  border-radius: 12px;
  background: rgba(255, 255, 255, .038);
}

.performance-kpis span {
  display: block;
  color: #86a0b8;
  font-size: .64rem;
}

.performance-kpis strong {
  display: block;
  margin-top: 5px;
  color: #eef9ff;
  font-family: Arial, sans-serif;
  font-size: .88rem;
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}

.performance-kpis .performance-answer-rate {
  border-color: rgba(74, 215, 166, .18);
  background: rgba(33, 166, 125, .055);
}

.performance-kpis .performance-answer-rate strong {
  color: #55e1ad;
  font-family: Yekan, Tahoma, Arial, sans-serif;
  direction: rtl;
}

@media (max-width: 1100px) and (min-width: 901px) {
  .performance-card-header {
    display: grid;
  }

  .performance-chart-switch {
    justify-self: start;
  }

  .performance-donut-view {
    grid-template-columns: 1fr;
  }

  .performance-donut-wrap {
    width: 148px;
  }
}

@media (max-width: 900px) {
  .status-card {
    min-height: 0;
  }

  .performance-card {
    max-width: 720px;
    margin: 0 auto;
  }

  .performance-donut-view {
    grid-template-columns: minmax(150px, .8fr) minmax(180px, 1.2fr);
  }
}

@media (max-width: 560px) {
  .status-card {
    gap: 18px;
    padding: 18px;
  }

  .status-card-intro .extension-display strong {
    font-size: 4.8rem;
  }

  .performance-card {
    padding: 14px;
    border-radius: 17px;
  }

  .performance-card-header {
    display: grid;
  }

  .performance-chart-switch {
    width: 100%;
  }

  .performance-chart-switch button {
    flex: 1;
  }

  .performance-bar-row {
    grid-template-columns: 82px minmax(55px, 1fr) 25px;
    gap: 7px;
  }

  .performance-donut-view {
    grid-template-columns: 1fr;
  }

  .performance-donut-wrap {
    width: 154px;
  }

  .performance-donut-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .performance-kpis {
    grid-template-columns: 1fr;
  }

  .performance-donut-legend {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .performance-bar-fill,
  .performance-donut-segment {
    animation: none;
  }
}

/* V7.2.4 — Direction-aware performance reporting */
.performance-chart-area {
  min-height: 360px;
}

.performance-bar-chart {
  min-height: 360px;
  gap: 8px;
}

.performance-bar-heading {
  margin: 5px 0 1px;
  padding: 6px 9px;
  border-right: 3px solid rgba(86, 183, 255, .78);
  border-radius: 8px;
  color: #d9edff;
  background: rgba(59, 142, 219, .08);
  font-size: .7rem;
  font-weight: 900;
  text-align: right;
}

.performance-bar-row {
  grid-template-columns: minmax(124px, 164px) minmax(70px, 1fr) 28px;
  gap: 8px;
}

.performance-bar-label {
  font-size: .68rem;
}

.performance-bar-row.incoming-total .performance-bar-fill {
  background: linear-gradient(90deg, #1dbf88, #55e7ad);
}

.performance-bar-row.outgoing-total .performance-bar-fill {
  background: linear-gradient(90deg, #377ff1, #69b5ff);
}

.performance-bar-row.incoming-answered .performance-bar-fill,
.performance-bar-row.outgoing-answered .performance-bar-fill {
  background: linear-gradient(90deg, #1dbf88, #55e7ad);
}

.performance-bar-row.incoming-missed .performance-bar-fill,
.performance-bar-row.outgoing-missed .performance-bar-fill {
  background: linear-gradient(90deg, #f04c69, #ff8395);
}

.performance-bar-row.incoming-busy .performance-bar-fill,
.performance-bar-row.outgoing-busy .performance-bar-fill {
  background: linear-gradient(90deg, #e99331, #ffc15a);
}

.performance-bar-row.incoming-failed .performance-bar-fill,
.performance-bar-row.outgoing-failed .performance-bar-fill {
  background: linear-gradient(90deg, #ad5dde, #df91ff);
}

.performance-bar-row.incoming-ringing .performance-bar-fill,
.performance-bar-row.outgoing-ringing .performance-bar-fill {
  background: linear-gradient(90deg, #2d79ff, #56b4ff);
}

.performance-donut-view {
  min-height: 360px;
  grid-template-columns: minmax(150px, .8fr) minmax(170px, 1.2fr);
}

.performance-donut-segment.incoming-answered { stroke: #35d49a; }
.performance-donut-segment.incoming-missed { stroke: #ff657b; }
.performance-donut-segment.incoming-busy { stroke: #f3a43f; }
.performance-donut-segment.incoming-failed { stroke: #bd6ce8; }
.performance-donut-segment.incoming-ringing { stroke: #4e9cff; }
.performance-donut-segment.outgoing-answered { stroke: #22aee3; }
.performance-donut-segment.outgoing-missed { stroke: #e34f85; }
.performance-donut-segment.outgoing-busy { stroke: #e47732; }
.performance-donut-segment.outgoing-failed { stroke: #8c67df; }
.performance-donut-segment.outgoing-ringing { stroke: #2f74d9; }

.performance-legend-item.incoming-answered .performance-legend-marker { background: #35d49a; }
.performance-legend-item.incoming-missed .performance-legend-marker { background: #ff657b; }
.performance-legend-item.incoming-busy .performance-legend-marker { background: #f3a43f; }
.performance-legend-item.incoming-failed .performance-legend-marker { background: #bd6ce8; }
.performance-legend-item.incoming-ringing .performance-legend-marker { background: #4e9cff; }
.performance-legend-item.outgoing-answered .performance-legend-marker { background: #22aee3; }
.performance-legend-item.outgoing-missed .performance-legend-marker { background: #e34f85; }
.performance-legend-item.outgoing-busy .performance-legend-marker { background: #e47732; }
.performance-legend-item.outgoing-failed .performance-legend-marker { background: #8c67df; }
.performance-legend-item.outgoing-ringing .performance-legend-marker { background: #2f74d9; }

.performance-donut-legend {
  max-height: 330px;
  overflow-y: auto;
  padding-left: 4px;
}

.performance-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.performance-kpis .incoming-rate {
  border-color: rgba(74, 215, 166, .22);
}

.performance-kpis .outgoing-rate {
  border-color: rgba(74, 167, 255, .25);
  background: rgba(42, 126, 203, .06);
}

.performance-kpis .outgoing-rate strong {
  color: #77bdff;
}

.performance-kpis .overall-rate strong {
  color: #d9efff;
}

@media (max-width: 1100px) {
  .performance-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .performance-bar-row {
    grid-template-columns: minmax(112px, 145px) minmax(52px, 1fr) 26px;
  }

  .performance-donut-view {
    grid-template-columns: 1fr;
  }

  .performance-donut-legend {
    max-height: none;
  }
}


/* V7.2.5 — Separate incoming/outgoing talk-time KPIs */
.performance-kpis .performance-talk.incoming-talk {
  border-color: rgba(74, 215, 166, .22);
  background: rgba(33, 166, 125, .065);
}

.performance-kpis .performance-talk.incoming-talk strong {
  color: #72e0b3;
}

.performance-kpis .performance-talk.outgoing-talk {
  border-color: rgba(80, 167, 255, .24);
  background: rgba(45, 126, 210, .065);
}

.performance-kpis .performance-talk.outgoing-talk strong {
  color: #8bc8ff;
}

/* =========================================================
   V7.3.0 — Readable layered performance dashboard
   Simple at first glance, exact details one level deeper
   ========================================================= */
@media (min-width: 901px) {
  .dashboard-grid {
    grid-template-columns: minmax(430px, 1.02fr) minmax(0, 1.28fr);
    align-items: start;
  }
}

.performance-shell {
  gap: 16px;
  padding: clamp(18px, 2.2vw, 26px);
}

.compact-status-intro {
  width: 100%;
  justify-items: stretch;
  padding: 12px 14px;
  border: 1px solid rgba(105, 175, 247, .14);
  border-radius: 17px;
  background: rgba(4, 24, 47, .42);
}

.status-overview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.compact-extension-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.compact-extension-display span {
  color: #92a8bd;
  font-size: .72rem;
}

.compact-extension-display strong {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  direction: ltr;
}

.compact-status-intro .connection-status {
  width: 100%;
  margin: 10px 0 0;
  padding: 7px 12px;
  text-align: center;
  font-size: .72rem;
}

.performance-card {
  padding: 16px;
}

.performance-primary-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.performance-primary-kpis article {
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid rgba(115, 178, 231, .14);
  border-radius: 13px;
  background: rgba(255, 255, 255, .038);
}

.performance-primary-kpis article.incoming {
  border-color: rgba(67, 211, 158, .22);
  background: rgba(32, 151, 113, .055);
}

.performance-primary-kpis article.outgoing {
  border-color: rgba(75, 165, 251, .24);
  background: rgba(42, 114, 190, .06);
}

.performance-primary-kpis article.success {
  border-color: rgba(79, 221, 191, .22);
}

.performance-primary-kpis span {
  display: block;
  color: #8fa5ba;
  font-size: .64rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.performance-primary-kpis strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.12rem;
  direction: ltr;
  text-align: right;
}

.performance-primary-kpis .incoming strong { color: #67dfb0; }
.performance-primary-kpis .outgoing strong { color: #81c3ff; }
.performance-primary-kpis .success strong {
  color: #65e3bd;
  font-family: Yekan, Tahoma, Arial, sans-serif;
  direction: rtl;
}

.performance-direction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.performance-direction-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(113, 177, 232, .16);
  border-radius: 15px;
  background: rgba(3, 20, 41, .58);
}

.performance-direction-card.incoming {
  border-color: rgba(61, 210, 154, .23);
  background: linear-gradient(145deg, rgba(16, 69, 69, .38), rgba(3, 22, 41, .64));
}

.performance-direction-card.outgoing {
  border-color: rgba(75, 164, 250, .25);
  background: linear-gradient(145deg, rgba(16, 55, 99, .42), rgba(3, 22, 41, .64));
}

.performance-direction-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.performance-direction-card > header span {
  display: block;
  color: #9bb0c3;
  font-size: .68rem;
}

.performance-direction-card > header strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: .9rem;
}

.performance-direction-card > header b {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: .66rem;
  white-space: nowrap;
}

.performance-direction-card.incoming > header b {
  color: #72e5b8;
  background: rgba(45, 183, 132, .12);
}

.performance-direction-card.outgoing > header b {
  color: #8dcaff;
  background: rgba(56, 133, 214, .14);
}

.direction-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.direction-status-grid > div {
  min-width: 0;
  padding: 7px 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  text-align: center;
}

.direction-status-grid span {
  display: block;
  color: #8ea4b8;
  font-size: .58rem;
  white-space: nowrap;
}

.direction-status-grid strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: .83rem;
}

.direction-status-grid .answered strong { color: #65dfa9; }
.direction-status-grid .missed strong { color: #ff8999; }
.direction-status-grid .busy strong { color: #ffc06a; }
.direction-status-grid .failed strong { color: #d9a0ff; }

.performance-direction-card > footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.performance-direction-card > footer span {
  display: block;
  color: #8198ae;
  font-size: .57rem;
}

.performance-direction-card > footer strong {
  display: block;
  margin-top: 3px;
  color: #eaf5ff;
  font-family: Arial, sans-serif;
  font-size: .74rem;
  direction: ltr;
  text-align: right;
}

.performance-chart-section {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.performance-chart-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.performance-chart-title-row > div > span {
  color: #6fb8ff;
  font-size: .62rem;
  font-weight: 800;
}

.performance-chart-title-row h3 {
  margin: 2px 0 0;
  color: #fff;
  font-size: .88rem;
}

.performance-chart-title-row > small {
  max-width: 220px;
  color: #8199af;
  font-size: .6rem;
  line-height: 1.6;
}

.performance-chart-area {
  min-height: 190px;
}

.performance-bar-chart {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  min-height: 190px;
}

.performance-bar-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(112, 177, 233, .12);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
}

.performance-bar-group.incoming { border-color: rgba(61, 210, 154, .16); }
.performance-bar-group.outgoing { border-color: rgba(75, 164, 250, .18); }

.performance-bar-group > header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.performance-bar-group > header strong {
  color: #eaf5ff;
  font-size: .72rem;
}

.performance-bar-group > header span {
  color: #8299ae;
  font-size: .62rem;
}

.performance-bar-row {
  grid-template-columns: 50px minmax(45px, 1fr) 22px;
  gap: 6px;
}

.performance-bar-label {
  font-size: .62rem;
}

.performance-bar-track {
  height: 8px;
}

.performance-donut-view {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  min-height: 190px;
}

.performance-mini-donut-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 7px 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(111, 177, 232, .13);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
}

.performance-mini-donut-card.incoming { border-color: rgba(61, 210, 154, .17); }
.performance-mini-donut-card.outgoing { border-color: rgba(75, 164, 250, .19); }

.performance-mini-donut-card h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: #dceaf5;
  font-size: .72rem;
}

.performance-mini-donut-card .performance-donut-wrap {
  width: 105px;
}

.performance-mini-donut-card .performance-donut-center strong {
  font-size: 1.35rem;
}

.performance-mini-donut-card .performance-donut-legend {
  gap: 6px;
}

.performance-mini-donut-card .performance-legend-item {
  font-size: .62rem;
}

.performance-advanced-details {
  margin-top: 11px;
  border: 1px solid rgba(113, 177, 232, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.performance-advanced-details summary {
  padding: 10px 12px;
  color: #a9bed0;
  font-size: .67rem;
  font-weight: 800;
  cursor: pointer;
}

.performance-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 0 10px 10px;
}

.performance-advanced-grid article {
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.performance-advanced-grid span {
  display: block;
  color: #8198ae;
  font-size: .59rem;
}

.performance-advanced-grid strong {
  display: block;
  margin-top: 4px;
  color: #eef8ff;
  font-family: Arial, sans-serif;
  font-size: .8rem;
  direction: ltr;
  text-align: right;
}

@media (max-width: 1120px) and (min-width: 901px) {
  .performance-direction-grid,
  .performance-bar-chart,
  .performance-donut-view {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .performance-shell {
    order: 2;
  }

  .recent-card {
    order: 1;
  }

  .performance-direction-grid,
  .performance-bar-chart,
  .performance-donut-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .status-overview-line,
  .performance-chart-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .performance-primary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-direction-grid,
  .performance-bar-chart,
  .performance-donut-view {
    grid-template-columns: 1fr;
  }

  .performance-chart-title-row > small {
    max-width: none;
  }
}

@media (max-width: 390px) {
  .direction-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-mini-donut-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .performance-mini-donut-card .performance-donut-legend {
    width: 100%;
  }
}

/* V7.3.2 — readable user performance summary */
.performance-card {
  padding: 20px;
}

.performance-card-header {
  margin-bottom: 18px;
}

.performance-card-header span {
  font-size: .82rem;
}

.performance-card-header h2 {
  font-size: 1.2rem;
  line-height: 1.65;
}

.performance-card-header small {
  max-width: none;
  font-size: .78rem;
  line-height: 1.85;
}

.performance-primary-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.performance-primary-kpis article {
  padding: 14px 13px;
  border-radius: 15px;
}

.performance-primary-kpis span {
  font-size: .76rem;
  overflow: visible;
  text-overflow: clip;
}

.performance-primary-kpis strong {
  margin-top: 7px;
  font-size: 1.4rem;
}

.performance-direction-grid {
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.performance-direction-card {
  padding: 16px;
  border-radius: 17px;
}

.performance-direction-card > header {
  margin-bottom: 14px;
}

.performance-direction-card > header span {
  font-size: .78rem;
}

.performance-direction-card > header strong {
  margin-top: 5px;
  font-size: 1.06rem;
}

.performance-direction-card > header b {
  padding: 7px 10px;
  font-size: .78rem;
}

.direction-status-grid {
  gap: 8px;
}

.direction-status-grid > div {
  padding: 10px 7px;
  border-radius: 11px;
}

.direction-status-grid span {
  font-size: .7rem;
}

.direction-status-grid strong {
  margin-top: 6px;
  font-size: 1rem;
}

.performance-direction-card > footer {
  gap: 9px;
  margin-top: 13px;
  padding-top: 12px;
}

.performance-direction-card > footer > div {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.performance-direction-card > footer span {
  font-size: .68rem;
}

.performance-direction-card > footer strong {
  margin-top: 5px;
  font-size: .9rem;
}

.performance-advanced-details {
  margin-top: 14px;
  border-radius: 15px;
  overflow: hidden;
}

.performance-advanced-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  color: #d2e3f1;
  font-size: .84rem;
  line-height: 1.75;
  list-style-position: inside;
}

.performance-advanced-details summary span {
  font-weight: 900;
}

.performance-advanced-details summary small {
  color: #829bb1;
  font-size: .7rem;
  font-weight: 500;
}

.performance-advanced-details[open] summary {
  border-bottom: 1px solid rgba(113, 177, 232, .12);
  background: rgba(37, 110, 172, .07);
}

.performance-advanced-content {
  padding: 14px;
}

.performance-advanced-content .performance-chart-switch {
  margin-bottom: 13px;
}

.performance-chart-switch button {
  min-height: 36px;
  padding: 0 14px;
  font-size: .78rem;
}

.performance-chart-section {
  padding-top: 0;
  border-top: 0;
}

.performance-chart-title-row > div > span {
  font-size: .72rem;
}

.performance-chart-title-row h3 {
  font-size: 1rem;
}

.performance-chart-title-row > small {
  font-size: .7rem;
}

.performance-bar-group > header strong,
.performance-mini-donut-card h4 {
  font-size: .82rem;
}

.performance-bar-group > header span,
.performance-bar-label,
.performance-mini-donut-card .performance-legend-item {
  font-size: .7rem;
}

.performance-advanced-grid {
  gap: 9px;
  padding: 14px 0 0;
}

.performance-advanced-grid article {
  padding: 12px;
}

.performance-advanced-grid span {
  font-size: .69rem;
}

.performance-advanced-grid strong {
  font-size: .94rem;
}

@media (max-width: 650px) {
  .performance-card {
    padding: 15px;
  }

  .performance-advanced-details summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

/* =========================================================
   V7.3.3 — accurate range summary + collapsed user dashboard
   ========================================================= */
.performance-overview-details {
  padding: 0 !important;
  overflow: hidden;
}

.performance-overview-details > summary,
.performance-advanced-details > summary {
  list-style: none;
}

.performance-overview-details > summary::-webkit-details-marker,
.performance-advanced-details > summary::-webkit-details-marker {
  display: none;
}

.performance-overview-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  padding: 19px 21px;
  color: #eef8ff;
  background:
    linear-gradient(135deg, rgba(31, 102, 166, .16), rgba(8, 39, 75, .08)),
    rgba(4, 24, 48, .28);
  cursor: pointer;
  user-select: none;
  transition: background .18s ease, box-shadow .18s ease;
}

.performance-overview-summary:hover {
  background:
    linear-gradient(135deg, rgba(37, 121, 194, .22), rgba(8, 39, 75, .11)),
    rgba(4, 24, 48, .34);
}

.performance-overview-details[open] > .performance-overview-summary {
  border-bottom: 1px solid rgba(113, 177, 232, .14);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .025);
}

.performance-overview-summary > div {
  min-width: 0;
}

.performance-overview-summary span:not(.performance-summary-arrow) {
  display: block;
  color: #79bdff;
  font-size: .82rem;
  font-weight: 900;
}

.performance-overview-summary h2 {
  margin: 5px 0 2px;
  color: #fff;
  font-size: 1.28rem;
  line-height: 1.55;
}

.performance-overview-summary small {
  display: block;
  color: #94acc1;
  font-size: .78rem;
  line-height: 1.8;
}

.performance-summary-arrow {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(91, 166, 239, .24);
  border-radius: 12px;
  color: #91c8ff !important;
  background: rgba(43, 118, 190, .12);
  font-family: Arial, sans-serif;
  font-size: 1.45rem !important;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .2s ease, background .18s ease;
}

.performance-overview-details[open] > .performance-overview-summary > .performance-summary-arrow,
.performance-advanced-details[open] > summary > .performance-summary-arrow {
  transform: rotate(180deg);
  background: rgba(43, 148, 190, .18);
}

.performance-overview-content {
  padding: 18px 20px 20px;
}

.performance-overview-content .performance-primary-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.performance-advanced-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.performance-advanced-details > summary > div {
  min-width: 0;
}

.performance-advanced-details > summary > div > span {
  display: block;
  color: #d9e9f5;
  font-size: .9rem;
  font-weight: 900;
}

.performance-advanced-details > summary > div > small {
  display: block;
  margin-top: 3px;
  color: #829bb1;
  font-size: .72rem;
  font-weight: 500;
}

.performance-advanced-details > summary .performance-summary-arrow {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1.25rem !important;
}

@media (max-width: 650px) {
  .performance-overview-summary {
    min-height: 82px;
    padding: 16px;
  }

  .performance-overview-content {
    padding: 14px;
  }

  .performance-overview-content .performance-primary-kpis {
    grid-template-columns: 1fr;
  }

  .performance-advanced-details > summary {
    align-items: center;
    flex-direction: row;
  }
}

/* =========================================================
   V7.3.4 — independent graphical drawer + readable donut labels
   ========================================================= */
.performance-shell > .performance-advanced-details {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(113, 177, 232, .18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(27, 92, 151, .12), rgba(6, 31, 61, .08)),
    rgba(4, 24, 48, .3);
}

.performance-shell > .performance-advanced-details > summary {
  min-height: 76px;
  padding: 17px 19px;
  cursor: pointer;
  user-select: none;
}

.performance-shell > .performance-advanced-details > summary > div > span {
  color: #eef8ff;
  font-size: 1.02rem;
  line-height: 1.7;
}

.performance-shell > .performance-advanced-details[open] > summary {
  border-bottom: 1px solid rgba(113, 177, 232, .14);
  background: rgba(37, 110, 172, .08);
}

.performance-shell > .performance-advanced-details > .performance-advanced-content {
  padding: 17px;
}

/* Each donut gets a full-width row so labels never compete for space. */
.performance-donut-view {
  grid-template-columns: 1fr !important;
  align-items: stretch;
  gap: 14px;
}

.performance-mini-donut-card {
  display: grid;
  grid-template-columns: minmax(145px, 180px) minmax(160px, 1fr);
  grid-template-areas:
    "title title"
    "chart legend";
  align-items: center;
  column-gap: 20px;
  row-gap: 10px;
  min-width: 0;
  padding: 17px;
}

.performance-mini-donut-card h4 {
  grid-area: title;
  margin: 0;
  font-size: 1rem;
}

.performance-mini-donut-card .performance-donut-wrap {
  grid-area: chart;
  width: min(100%, 170px);
}

.performance-mini-donut-card .performance-donut-legend {
  grid-area: legend;
  width: 100%;
  min-width: 0;
  gap: 10px;
}

.performance-mini-donut-card .performance-legend-item {
  grid-template-columns: 10px minmax(88px, 1fr) auto;
  gap: 10px;
  min-width: 0;
  padding: 5px 0;
  font-size: .86rem;
  line-height: 1.65;
}

.performance-mini-donut-card .performance-legend-item span:nth-child(2) {
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  color: #dbe8f3;
  font-weight: 700;
}

.performance-mini-donut-card .performance-legend-item strong {
  min-width: 28px;
  font-size: .94rem;
  text-align: left;
}

.performance-mini-donut-card .performance-legend-marker {
  width: 9px;
  height: 9px;
}

@media (max-width: 520px) {
  .performance-mini-donut-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "chart"
      "legend";
  }

  .performance-mini-donut-card .performance-donut-wrap {
    width: min(100%, 185px);
  }
}


/* =========================================================
   V7.3.5 — balanced columns, simplified drawer titles, Persian digits
   ========================================================= */
@media (min-width: 901px) {
  .dashboard-grid {
    align-items: stretch;
  }

  .recent-card {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .recent-list {
    flex: 1 1 630px;
    min-height: 0;
    max-height: none;
  }
}

.performance-overview-summary > div > span,
.performance-shell > .performance-advanced-details > summary > div > span {
  color: #79bdff;
  font-size: .82rem;
  font-weight: 900;
}

.performance-shell > .performance-advanced-details > summary > div > h2 {
  margin: 5px 0 0;
  color: #fff;
  font-size: 1.18rem;
  line-height: 1.55;
}

/* Keep every visible number in the same Persian type treatment. */
.dashboard strong,
.dashboard b,
.dashboard .recent-number,
.dashboard .recent-time,
.dashboard .recent-date,
.profile-overlay strong,
.call-analysis-overlay strong {
  font-family: Yekan, Tahoma, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 650px) {
  .performance-shell > .performance-advanced-details > summary > div > h2 {
    font-size: 1.02rem;
  }
}

/* =========================================================
   V7.3.6 — keep call cards compact while the history viewport grows
   ========================================================= */
@media (min-width: 901px) {
  /* The left column still follows the expanded height of the right column. */
  .recent-card {
    min-height: 0;
  }

  /* Extra vertical room must reveal more calls, not stretch existing rows. */
  .recent-list {
    align-content: start;
    align-items: start;
    grid-auto-flow: row;
    grid-auto-rows: max-content;
  }

  .recent-item {
    align-self: start;
    height: auto;
    min-height: 0;
  }
}

/* =========================================================
   V7.3.7 — expose .env report limits beside the date filter
   ========================================================= */
.history-range-hint {
  display: grid;
  gap: 2px;
  min-height: auto;
}

.history-range-hint span {
  display: block;
}



/* =========================================================
   V7.3.8 — align the report button with Jalali date controls
   ========================================================= */
.history-date-filter {
  align-items: start;
}

.history-date-action-label {
  visibility: hidden;
  min-height: 19px;
  color: #b8c9da;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.5;
  user-select: none;
  pointer-events: none;
}

.history-date-filter-action {
  align-content: start;
}

.history-date-filter-action .history-date-submit {
  width: 100%;
}

@media (max-width: 760px) {
  .history-date-action-label {
    display: none;
  }
}


/* =========================================================
   V7.3.10 — exact structural alignment for report controls
   ========================================================= */
@media (min-width: 761px) {
  /* Use identical grid rows for both date controls and the action column.
     This aligns the button to the date boxes without pixel nudges. */
  .history-date-filter label,
  .history-date-filter-action {
    grid-template-rows: 19px 43px auto;
    row-gap: 6px;
    align-content: start;
  }

  .history-date-filter label > span,
  .history-date-action-label {
    display: flex;
    align-items: flex-end;
    height: 19px;
    min-height: 19px;
    line-height: 19px;
    margin: 0;
  }

  .history-jalali-date-button,
  .history-date-submit {
    height: 43px;
    min-height: 43px;
    margin: 0;
  }

  .history-date-filter-action {
    align-self: start;
  }
}

/* V7.7.2 — internal-to-internal history badge */
.recent-direction.internal {
  color: #d8c7ff;
  border: 1px solid rgba(181, 150, 255, .28);
  background: rgba(132, 92, 220, .16);
}

.recent-item.internal {
  border-color: rgba(181, 150, 255, .25);
}

/* =========================================================
   V7.7.4 — Nextcloud machine picture gallery
   Isolated from the customer/profile layout except for the serial link.
   ========================================================= */
.machine-gallery-open {
  overflow: hidden;
}

.machine-serial-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px dashed rgba(126, 184, 255, .72);
  color: #8dc3ff;
  background: transparent;
  font: inherit;
  font-weight: 900;
  line-height: 1.5;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}

.machine-serial-link:hover,
.machine-serial-link:focus-visible {
  color: #d9ecff;
  border-bottom-color: #d9ecff;
  transform: translateY(-1px);
  outline: none;
}

.machine-gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 9, 22, .84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.machine-gallery-overlay.hidden {
  display: none !important;
}

.machine-gallery-panel {
  width: min(1120px, 100%);
  max-height: min(94dvh, 940px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(116, 181, 255, .30);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(8, 39, 76, .99), rgba(3, 18, 38, .995));
  box-shadow: 0 34px 120px rgba(0, 0, 0, .68), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.machine-gallery-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: rgba(9, 48, 93, .86);
}

.machine-gallery-header h2 {
  margin: 3px 0 2px;
  color: #f7fbff;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
}

.machine-gallery-header p {
  margin: 3px 0 0;
  color: #9db9d7;
  font-size: .84rem;
}

.machine-gallery-header p strong {
  color: #dcecff;
  font-family: Arial, sans-serif;
  letter-spacing: .025em;
}

.machine-gallery-kicker {
  color: #72b4ff;
  font-size: .75rem;
  font-weight: 900;
}

.machine-gallery-close {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
  font-size: 1.7rem;
  line-height: 1;
  padding: 0 0 3px;
  box-sizing: border-box;
  cursor: pointer;
}

.machine-gallery-close:hover {
  background: rgba(255, 255, 255, .13);
}

.machine-gallery-status {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
}

.machine-gallery-status.hidden {
  display: none !important;
}

.machine-gallery-status > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-weight: 900;
}

.machine-gallery-status strong {
  display: block;
  color: #f5f9ff;
}

.machine-gallery-status p {
  margin: 4px 0 0;
  color: #aebfd1;
  line-height: 1.75;
}

.machine-gallery-status.loading > span {
  color: #dcecff;
  background: rgba(52, 143, 255, .20);
}

.machine-gallery-status.empty {
  border-color: rgba(120, 167, 218, .22);
  background: rgba(94, 137, 185, .07);
}

.machine-gallery-status.empty > span {
  color: #dcecff;
  background: rgba(94, 137, 185, .18);
}

.machine-gallery-status.error {
  border-color: rgba(255, 104, 118, .30);
  background: rgba(255, 82, 101, .07);
}

.machine-gallery-status.error > span {
  color: #ffe5e8;
  background: rgba(255, 82, 101, .20);
}

.machine-gallery-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 22px;
}

.machine-gallery-content.hidden {
  display: none !important;
}

.machine-gallery-stage {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 13px;
}

.machine-gallery-image-wrap {
  min-height: min(58dvh, 570px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .025) 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, rgba(255, 255, 255, .025) 25%, transparent 25%) 0 10px / 20px 20px,
    rgba(0, 9, 21, .56);
}

.machine-gallery-image-wrap img {
  display: block;
  width: 100%;
  max-height: min(58dvh, 570px);
  object-fit: contain;
}

.machine-gallery-image-wrap video {
  display: block;
  width: 100%;
  max-height: min(58dvh, 570px);
  object-fit: contain;
  background: #000;
}

.machine-gallery-image-wrap img.hidden,
.machine-gallery-image-wrap video.hidden {
  display: none !important;
}

.machine-gallery-nav {
  width: 52px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 184, 255, .22);
  border-radius: 15px;
  color: #e7f2ff;
  background: rgba(76, 142, 224, .10);
  font-family: Arial, sans-serif;
  font-size: 2rem;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.machine-gallery-nav:hover:not(:disabled) {
  background: rgba(76, 142, 224, .22);
  transform: translateY(-1px);
}

.machine-gallery-nav:disabled {
  opacity: .28;
  cursor: default;
}

.machine-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 65px 0;
  color: #94aec9;
  font-size: .78rem;
}

.machine-gallery-meta strong {
  color: #d9eaff;
}

.machine-gallery-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-gallery-thumbnails {
  display: flex;
  gap: 9px;
  margin-top: 15px;
  padding: 8px 2px 2px;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.machine-gallery-thumbnail {
  width: 86px;
  height: 68px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  color: #9ebcdb;
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.machine-gallery-thumbnail:hover {
  transform: translateY(-1px);
  background: rgba(83, 151, 232, .12);
}

.machine-gallery-thumbnail.active {
  border-color: rgba(114, 180, 255, .88);
  background: rgba(83, 151, 232, .16);
}

.machine-gallery-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.machine-gallery-thumbnail img.hidden,
.machine-gallery-thumbnail-placeholder.hidden {
  display: none !important;
}

.machine-gallery-thumbnail-placeholder {
  font-family: Arial, sans-serif;
  font-size: .85rem;
  font-weight: 800;
}

.admission-video-thumbnail {
  display: grid;
  place-items: center;
  gap: 2px;
  color: #dcecff;
}

.admission-video-thumbnail > span {
  font-size: 1.25rem;
  line-height: 1;
}

.admission-video-thumbnail small {
  font-family: inherit;
  font-size: .66rem;
}

@media (max-width: 700px) {
  .machine-gallery-overlay {
    padding: 8px;
  }

  .machine-gallery-panel {
    max-height: 97dvh;
    border-radius: 20px;
  }

  .machine-gallery-header {
    padding: 15px 16px 13px;
  }

  .machine-gallery-stage {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 7px;
  }

  .machine-gallery-image-wrap {
    min-height: 48dvh;
  }

  .machine-gallery-image-wrap img,
  .machine-gallery-image-wrap video {
    max-height: 48dvh;
  }

  .machine-gallery-nav {
    width: 42px;
    height: 50px;
    border-radius: 12px;
    font-size: 1.7rem;
  }

  .machine-gallery-meta {
    margin-inline: 49px;
  }

  .machine-gallery-thumbnail {
    width: 72px;
    height: 58px;
  }
}
