@font-face {
  font-family: yekan;
  font-style: normal;
  font-weight: 400;
  src: url("fonts/iran-yekan-400.woff2") format("woff2");
}
@font-face {
  font-family: yekan;
  font-style: normal;
  font-weight: 500;
  src: url("fonts/iran-yekan-500.woff2") format("woff2");
}
@font-face {
  font-family: yekan;
  font-style: normal;
  font-weight: 700;
  src: url("fonts/iran-yekan-700.woff2") format("woff2");
}

:root {
  --md-blue: #0a50d2;
  --md-blue-2: #1b68ff;
  --md-navy: #0f2744;
  --md-text: #1f2937;
  --md-muted: #6b7280;
  --md-border: rgba(15, 39, 68, 0.08);
  --md-active-bg: rgba(27, 104, 255, 0.1);
}

body.admin-body,
body.admin-auth-page,
body.admin-body input,
body.admin-body button,
body.admin-body select,
body.admin-body textarea {
  font-family: yekan, Tahoma, sans-serif;
}

body.admin-body,
body.admin-auth-page {
  background: #f3f6fb;
  color: var(--md-text);
}

.admin-main {
  min-height: calc(100vh - 64px);
}

.admin-main > .container-fluid {
  max-width: 1440px;
  padding: 1.25rem 1.5rem 2.5rem;
}

/* ——— Navbar ——— */
.md-navbar {
  --md-nav-height: 64px;
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--md-nav-height);
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--md-border);
  box-shadow: 0 1px 3px rgba(15, 39, 68, 0.05), 0 8px 24px rgba(15, 39, 68, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.md-navbar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--md-nav-height);
  padding: 0 1.1rem;
}

.md-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--md-blue) !important;
  letter-spacing: -0.02em;
}

.md-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.md-brand:hover {
  color: var(--md-blue-2) !important;
}

.md-brand:hover img {
  transform: scale(1.05);
}

.md-toggler {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--md-border);
  border-radius: 10px;
  background: transparent;
}

.md-toggler span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: #4b5563;
  border-radius: 2px;
}

.md-nav {
  display: flex;
  align-items: center;
  gap: 0.12rem;
  padding: 0.4rem 0;
}

.md-navbar .md-nav > .nav-item > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.78rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: #5c6678 !important;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.md-navbar .md-nav > .nav-item > .nav-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.72;
  flex-shrink: 0;
}

.md-navbar .md-nav > .nav-item > .nav-link:hover,
.md-navbar .md-nav > .nav-item > .nav-link:focus {
  color: var(--md-navy) !important;
  background: rgba(15, 39, 68, 0.045);
}

.md-navbar .md-nav > .nav-item > .nav-link.active {
  color: var(--md-blue-2) !important;
  background: var(--md-active-bg);
  font-weight: 700;
}

.md-navbar .md-nav > .nav-item > .nav-link.active svg {
  opacity: 1;
}

.md-navbar .dropdown-toggle::after {
  margin-right: 0.3rem;
  margin-left: 0;
  opacity: 0.55;
  vertical-align: 0.15em;
}

.md-dropdown {
  min-width: 12.5rem;
  padding: 0.4rem;
  margin-top: 0.4rem !important;
  border: 1px solid var(--md-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 39, 68, 0.12);
}

.md-dropdown .dropdown-item {
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: #5c6678;
  border-radius: 8px;
}

.md-dropdown .dropdown-item:hover,
.md-dropdown .dropdown-item:focus {
  background: var(--md-active-bg);
  color: var(--md-blue-2);
}

.md-dropdown .dropdown-item.text-danger:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #b02a37 !important;
}

.md-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.28rem 0.4rem 0.28rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(15, 39, 68, 0.03);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.md-user-toggle.dropdown-toggle::after {
  display: none;
}

.md-user-toggle:hover {
  background: #fff;
  border-color: var(--md-border);
}

.md-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.md-user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--md-navy);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-user-role {
  font-size: 0.7rem;
  color: var(--md-muted);
}

.md-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  user-select: none;
}

.md-avatar.sm {
  width: 34px;
  height: 34px;
  font-size: 0.7rem;
}

.md-avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.05rem;
}

.md-user-menu {
  min-width: 15rem;
}

.md-user-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.55rem 0.85rem 0.25rem;
}

.md-user-menu-head strong {
  font-size: 0.9rem;
  color: var(--md-navy);
}

.md-user-menu-head small {
  color: var(--md-muted);
  font-size: 0.75rem;
}

.md-user-actions {
  margin-inline-start: auto;
}

@media (min-width: 992px) {
  .md-navbar .navbar-collapse {
    display: flex !important;
    align-items: center;
    flex: 1 1 auto;
  }
}

/* ——— Page chrome ——— */
.page-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--md-blue-2);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.page-title {
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
  color: var(--md-navy);
}

.page-desc {
  color: var(--md-muted);
  margin-bottom: 1.25rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.admin-card {
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  padding: 1.15rem 1.2rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.9rem;
}

.card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--md-navy);
}

.card-head a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--md-blue-2);
  text-decoration: none;
}

.card-head a:hover {
  text-decoration: underline;
}

.card-head a.btn,
.card-head a.csr-download-btn {
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none !important;
}

.card-head a.btn-primary,
a.csr-download-btn.btn-primary {
  color: #fff !important;
  background: #0a50d2 !important;
  border-color: #0a50d2 !important;
}

.card-head a.btn-primary:hover,
a.csr-download-btn.btn-primary:hover {
  color: #fff !important;
  background: #1b68ff !important;
  border-color: #1b68ff !important;
  text-decoration: none !important;
}

.csr-date {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.csr-artifact .csr-copy-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.csr-artifact .csr-copy-btn.is-copied {
  color: #047857;
  border-color: #047857;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: #e5eaf1;
  min-height: 42px;
}

.form-control:focus,
.form-select:focus {
  border-color: #93b4ff;
  box-shadow: 0 0 0 3px rgba(27, 104, 255, 0.12);
}

/* ——— Dashboard ——— */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid #e4ecfb;
  border-radius: 18px;
}

.stat-card {
  display: block;
  text-decoration: none;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.05rem 0.95rem;
  border: 1px solid #eef1f5;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.stat-card .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 0.7rem;
}

.stat-card .stat-icon svg {
  width: 16px;
  height: 16px;
}

.stat-card .label {
  color: var(--md-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.stat-card .value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--md-navy);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.stat-card .value-sm {
  font-size: 1.05rem;
}

.stat-card.tone-blue {
  border-color: #dbe7ff;
}
.stat-card.tone-blue .stat-icon { background: #e8f0ff; color: #1b68ff; }
.stat-card.tone-blue .value { color: #0a50d2; }

.stat-card.tone-green {
  border-color: #d7f5e7;
}
.stat-card.tone-green .stat-icon { background: #ecfdf5; color: #059669; }
.stat-card.tone-green .value { color: #047857; }

.stat-card.tone-navy {
  border-color: #dce4f5;
}
.stat-card.tone-navy .stat-icon { background: #eef2ff; color: #1e3a8a; }
.stat-card.tone-navy .value { color: #1e3a8a; }

.stat-card.tone-violet {
  border-color: #eadcff;
}
.stat-card.tone-violet .stat-icon { background: #f5f3ff; color: #7c3aed; }
.stat-card.tone-violet .value { color: #6d28d9; }

.stat-card.tone-orange {
  border-color: #ffe1cc;
}
.stat-card.tone-orange .stat-icon { background: #fff7ed; color: #c2410c; }
.stat-card.tone-orange .value { color: #c2410c; }

.stat-card.tone-teal {
  border-color: #cceeea;
}
.stat-card.tone-teal .stat-icon { background: #f0fdfa; color: #0d9488; }
.stat-card.tone-teal .value { color: #0f766e; }

.dash-list {
  display: flex;
  flex-direction: column;
}

.dash-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid #f1f4f8;
  text-decoration: none;
  color: inherit;
}

.dash-row:last-child {
  border-bottom: 0;
}

a.dash-row:hover {
  background: #f8fafc;
  border-radius: 10px;
  padding-right: 0.4rem;
  padding-left: 0.4rem;
}

.dash-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.dash-row-main strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--md-navy);
}

.dash-row-main small {
  color: var(--md-muted);
  font-size: 0.75rem;
}

.dash-row-meta {
  text-align: left;
  font-size: 0.75rem;
  color: var(--md-muted);
  flex-shrink: 0;
}

/* ——— User panel ——— */
.user-panel-shell {
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.15rem;
  overflow: hidden;
}

.user-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
}

.user-hero-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.user-hero-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--md-navy);
  line-height: 1.3;
}

.user-hero-sub {
  color: var(--md-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.user-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.md-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
}

.md-chip.is-ok {
  background: #ecfdf5;
  color: #047857;
}

.md-chip.is-warn {
  background: #fff7ed;
  color: #c2410c;
}

.md-chip.is-info {
  background: #eef4ff;
  color: #1b68ff;
}

.md-chip.is-muted {
  background: #f3f4f6;
  color: #6b7280;
}

.user-panel-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0.45rem 0.7rem 0.65rem;
  border-top: 1px solid #eef1f5;
  background: #fff;
}

.user-panel-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: #4b5563;
  font-weight: 500;
  font-size: 0.82rem;
  padding: 0.48rem 0.8rem;
  border-radius: 10px;
}

.user-panel-nav a svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.user-panel-nav a.active,
.user-panel-nav a:hover {
  background: var(--md-active-bg);
  color: var(--md-blue-2);
}

.user-panel-nav a.active {
  font-weight: 700;
}

.user-panel-nav a.active svg,
.user-panel-nav a:hover svg {
  opacity: 1;
}

.user-facts {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.user-fact {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #f1f4f8;
  font-size: 0.84rem;
}

.user-fact:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.user-fact span {
  color: var(--md-muted);
}

.user-fact strong {
  font-weight: 700;
  color: var(--md-navy);
  text-align: left;
}

.credit-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding: 1.15rem 1.3rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 55%, #ffffff 100%);
  border: 1px solid #cceeea;
  border-radius: 18px;
}

.credit-balance-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f766e;
  line-height: 1.3;
}

.credit-balance-hint {
  color: var(--md-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.admin-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eef4ff 0%, #f7f8fa 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(10, 80, 210, 0.12);
}

.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.auth-captcha {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.auth-captcha button {
  flex: 0 0 auto;
  border: 1px solid #dbe4f0;
  background: #f0f5ff;
  border-radius: 10px;
  padding: 0;
  line-height: 0;
  overflow: visible;
}

.auth-captcha img {
  display: block;
  width: 180px;
  height: 56px;
  max-width: none;
}

.btn-primary {
  background: #0a50d2;
  border-color: #0a50d2;
  color: #fff;
}

.btn-primary:hover {
  background: #1b68ff;
  border-color: #1b68ff;
  color: #fff;
}

.btn {
  border-radius: 10px;
}

.admin-table-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.table-wrapper {
  padding: 1rem;
}

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

.table-per-page {
  width: auto;
  min-width: 140px;
}

.table-wrapper .table-responsive {
  border: 1px solid #e9ecef;
  border-radius: 10px;
}

.dynamic-table {
  margin-bottom: 0;
  font-size: 13px;
}

.dynamic-table thead tr.table-header-labels th {
  background: linear-gradient(180deg, #f8f9fb 0%, #eef1f5 100%);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid #dee2e6;
}

.dynamic-table thead tr.table-header-labels th.is-sortable {
  cursor: pointer;
  user-select: none;
}

.dynamic-table thead tr.table-header-labels th.is-sortable:hover {
  background: #e8eef8;
}

.dynamic-table thead tr.table-header-labels th.is-sorted {
  color: #0a50d2;
}

.th-sort::after {
  content: "↕";
  margin-right: 6px;
  color: #9ca3af;
  font-size: 11px;
}

.dynamic-table thead th.is-sorted.dir-asc .th-sort::after {
  content: "↑";
  color: #0a50d2;
}

.dynamic-table thead th.is-sorted.dir-desc .th-sort::after {
  content: "↓";
  color: #0a50d2;
}

.dynamic-table thead tr.table-header-filters th {
  background: #fff;
  padding: 8px;
}

.table-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

.pagination-info {
  color: #6b7280;
  font-size: 13px;
}

.dynamic-table td.actions a {
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .md-toggler {
    display: flex;
  }

  .md-navbar-inner {
    flex-wrap: wrap;
    padding: 0 0.75rem;
  }

  .md-navbar .navbar-collapse {
    width: 100%;
    padding: 0.4rem 0 0.9rem;
  }

  .md-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .md-navbar .md-nav > .nav-item > .nav-link {
    width: 100%;
    padding: 0.7rem 0.85rem;
  }

  .md-user-actions {
    width: 100%;
    margin: 0.5rem 0 0;
  }

  .md-user-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .md-user-name {
    max-width: none;
  }

  .dash-hero,
  .user-hero,
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .user-hero-chips {
    justify-content: flex-start;
  }
}

.admin-call-audio {
  width: 11.5rem;
  max-width: 100%;
  height: 2rem;
  vertical-align: middle;
}

.admin-calls-toggle {
  font-weight: 700;
  text-decoration: none;
}

.admin-calls-legs {
  padding: 0.85rem 1rem 1rem;
  background: #f8fafc;
  border-top: 1px dashed #e2e8f0;
  text-align: right;
}
