:root {
  --primary: #3F5BFF;
  --bg-light: #f6f7fb;
  --bg-dark: #0c0f16;
  --card-light: #ffffff;
  --card-dark: #141925;
  --text-light: #0b0f19;
  --text-dark: #f3f4f8;
  --muted-light: #6b7280;
  --muted-dark: #98a2b3;
  --border-light: rgba(15, 23, 42, 0.1);
  --border-dark: rgba(148, 163, 184, 0.2);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: sans-serif;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.theme-light {
  background: radial-gradient(circle at 10% 10%, rgba(73, 107, 247, 0.08), transparent 45%), var(--bg-light);
  color: var(--text-light);
}

body.theme-dark {
  background: radial-gradient(circle at 10% 10%, rgba(73, 107, 247, 0.18), transparent 45%), var(--bg-dark);
  color: var(--text-dark);
}

.fw-semibold {
  font-weight: 600 !important;
}

.spinner-overlay-text,
.copy-loader-message,
.loading-text,
.loading-sub {
  font-weight: 500 !important;
}

.navbar {
  backdrop-filter: blur(12px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar.theme-light {
  background-color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-light);
}

.navbar.theme-dark {
  background-color: rgba(12, 15, 22, 0.9);
  border-bottom: 1px solid var(--border-dark);
}

.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link.active:focus,
.navbar .navbar-nav .nav-link.active:hover {
  color: var(--primary);
  font-weight: 600;
}

.brand-pill {
  background: rgba(73, 107, 247, 0.15);
  color: var(--primary);
  border: 1px solid rgba(73, 107, 247, 0.4);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
}

.card,
.table,
.dropdown-menu {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body.theme-light .card {
  background-color: var(--card-light);
  border: 1px solid var(--border-light);
}

body.theme-dark .card {
  background-color: var(--card-dark);
  border: 1px solid var(--border-dark);
}

.badge-status {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.status-online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-offline {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(73, 107, 247, 0.35);
}

.upgrade-plan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #20c997);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 0.95rem 1.8rem rgba(13, 110, 253, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.upgrade-plan-btn:hover,
.upgrade-plan-btn:focus,
.upgrade-plan-btn:focus-visible {
  color: #fff;
  background: linear-gradient(90deg, var(--primary), #20c997);
  transform: translateY(-1px);
  box-shadow: 0 1.05rem 2rem rgba(13, 110, 253, 0.28);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

button:focus,
button:focus-visible,
.btn:focus,
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  box-shadow: none;
}

.theme-toggle-btn {
  position: relative;
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
}

.theme-toggle-btn .theme-icon {
  position: absolute;
  font-size: 18px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-toggle-btn[data-theme="light"] .theme-icon-light {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle-btn[data-theme="light"] .theme-icon-dark {
  opacity: 0;
  transform: scale(0.6) rotate(-20deg);
}

.theme-toggle-btn[data-theme="dark"] .theme-icon-light {
  opacity: 0;
  transform: scale(0.6) rotate(20deg);
}

.theme-toggle-btn[data-theme="dark"] .theme-icon-dark {
  opacity: 1;
  transform: scale(1);
}

.card-title-icon {
  font-size: 18px;
  opacity: 0.8;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.combined-summary-card .summary-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.combined-summary-card .summary-status,
.combined-summary-card .summary-details {
  min-width: 0;
}

.combined-summary-card .summary-details {
  display: flex;
  flex-direction: column;
}

.combined-summary-card .summary-status {
  min-width: 220px;
}

.combined-summary-card .summary-details {
  min-width: 240px;
}

.summary-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  min-width: 0;
}

body.theme-light .summary-item {
  background: rgba(73, 107, 247, 0.08);
  border-color: rgba(73, 107, 247, 0.2);
}

body.theme-dark .summary-item {
  background: rgba(73, 107, 247, 0.2);
  border-color: rgba(73, 107, 247, 0.3);
}

.summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(73, 107, 247, 0.2);
  color: var(--primary);
}

.summary-icon .material-icons {
  font-size: 18px;
}

.portfolio-profit-value {
  min-width: 0;
}

body.theme-dark .portfolio-profit-value {
  color: #f3f4f8 !important;
}

.combined-summary-card .summary-item>div:last-child {
  min-width: 0;
  flex: 1;
}

.combined-summary-card .summary-item .small.text-muted {
  font-size: 0.72rem;
  line-height: 1.1;
}

.combined-summary-card .summary-item .fw-semibold {
  min-width: 0;
  display: block;
  font-size: 0.82rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combined-summary-card .summary-item [data-summary] {
  font-size: 0.82rem;
  line-height: 1.15;
}

.combined-summary-card .summary-item [data-summary="net_profit"],
.combined-summary-card .summary-item [data-summary="total_trades"] {
  font-size: 0.88rem;
}

.combined-summary-card .summary-item .d-flex {
  min-width: 0;
}

.combined-summary-card .summary-item .d-flex>div {
  min-width: 0;
}

.combined-summary-card .summary-item .copy-btn {
  flex: 0 0 auto;
}

body.theme-dark .combined-summary-card .material-icons {
  color: #fff;
  opacity: 1;
}

body.theme-dark .combined-summary-card .card-title-icon {
  color: #fff;
  opacity: 1;
}

body.theme-dark .combined-summary-card .summary-icon {
  color: #fff;
}

body.theme-dark .combined-summary-card .empty-state .material-icons {
  color: #fff;
  opacity: 1;
}

body.theme-dark .combined-summary-card .copy-btn .material-icons {
  color: var(--primary);
  opacity: 1;
}

.empty-state {
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

.empty-state .material-icons {
  font-size: 32px;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.table td {
  font-size: 0.75rem;
  white-space: nowrap;
}

table.dataTable thead>tr>th,
table.dataTable thead>tr>td,
table.dataTable tbody>tr>th,
table.dataTable tbody>tr>td {
  text-align: left !important;
}

table.dataTable th.dt-type-numeric,
table.dataTable td.dt-type-numeric,
table.dataTable th.dt-right,
table.dataTable td.dt-right,
table.dataTable th.dt-center,
table.dataTable td.dt-center {
  text-align: left !important;
}

table.dataTable thead>tr>th div.dt-column-header,
table.dataTable thead>tr>td div.dt-column-header,
table.dataTable tfoot>tr>th div.dt-column-footer,
table.dataTable tfoot>tr>td div.dt-column-footer {
  justify-content: flex-start;
}

table.dataTable thead>tr>th:first-child,
table.dataTable thead>tr>td:first-child,
table.dataTable tbody>tr>th:first-child,
table.dataTable tbody>tr>td:first-child {
  text-align: left !important;
}

table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,
table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control {
  cursor: pointer;
}

table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,
table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before {
  color: #716c6c;
}

table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td,
table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th,
table.dataTable.dtr-inline.collapsed>tbody>tr.child ul.dtr-details,
table.dataTable.dtr-inline.collapsed>tbody>tr.child ul.dtr-details>li,
table.dataTable.dtr-inline.collapsed>tbody>tr.child span.dtr-data,
table.dataTable.dtr-inline.collapsed>tbody>tr.child span.dtr-title {
  white-space: normal;
}

.dt-buttons {
  margin: 17px 0;
  gap: 0.5rem;
}

.dt-length,
.dt-search {
  margin: 16px 0;
}

.dt-info {
  margin-top: 16px;
}

body.theme-dark .table {
  color: var(--text-dark);
}

body.theme-dark .table thead th {
  color: var(--muted-dark);
}

.market-session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

.market-session.open {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.market-session.closed {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.heatmap-cell {
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
}

body.theme-light .heatmap-cell {
  background: rgba(73, 107, 247, 0.08);
  border-color: rgba(73, 107, 247, 0.18);
}

body.theme-dark .heatmap-cell {
  background: rgba(73, 107, 247, 0.18);
  border-color: rgba(73, 107, 247, 0.28);
}

.tv-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tv-widget {
  min-height: 140px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid transparent;
}

.ticker-card {
  overflow: hidden;
}

.tv-ticker {
  min-height: auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid transparent;
}

body.theme-light .tv-widget {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--border-light);
}

body.theme-dark .tv-widget {
  background: rgba(20, 25, 37, 0.65);
  border-color: var(--border-dark);
}

body.theme-light .tv-ticker {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--border-light);
}

body.theme-dark .tv-ticker {
  background: rgba(20, 25, 37, 0.65);
  border-color: var(--border-dark);
}

.major-pairs-card {
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.major-pairs-media {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(73, 107, 247, 0.2)),
    url("/images/world-map.png");
  background-size: cover;
  background-position: center;
  opacity: 0.10;
}

body.theme-dark .major-pairs-media {
  background-image:
    linear-gradient(135deg, rgba(10, 15, 22, 0.6), rgba(10, 15, 22, 0.85)),
    url("/images/world-map.png");
}

.major-pairs-content {
  position: relative;
  z-index: 1;
}

body.theme-dark .major-pairs-card {
  color: var(--text-dark);
}

body.theme-light .major-pairs-card {
  color: var(--text-light);
}


.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 15, 22, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.spinner-overlay.active {
  display: flex;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

.auth-panel {
  max-width: 420px;
  margin: 0 auto;
}

.auth-divider {
  position: relative;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 0.85rem;
}

body.theme-light .auth-divider span {
  background: var(--card-light);
}

body.theme-dark .auth-divider span {
  background: var(--card-dark);
  color: #cbd5e1;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  border-color: rgba(73, 107, 247, 0.35);
}

.btn-google-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ea4335, #fbbc05 48%, #34a853 76%, #4285f4);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

body.theme-dark .btn-google {
  background: rgba(20, 25, 37, 0.95);
  color: var(--text-dark);
  border-color: var(--border-dark);
}

.fade-in {
  animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {
  .heatmap-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .tv-widgets {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 992px) {
  .combined-summary-card .summary-layout {
    grid-template-columns: 260px 1fr;
  }
}

.dataTables_wrapper .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  justify-content: flex-start;
}

.dataTables_wrapper .dt-buttons .btn {
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  max-width: 54px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter {
  margin-bottom: 0.5rem;
}

.link-arrow {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.link-arrow::after {
  content: "→";
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

body.theme-dark .link-arrow {
  color: #8ea2ff;
}

.link-icon {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
}

.link-icon .material-icons {
  font-size: 18px;
}

body.theme-dark .link-icon {
  color: #8ea2ff;
}

.copy-btn {
  background: rgba(73, 107, 247, 0.12);
  border: 1px solid rgba(73, 107, 247, 0.25);
  color: var(--primary);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.copy-btn .material-icons {
  font-size: 16px;
}

.copy-btn:hover {
  transform: translateY(-1px);
  background: rgba(73, 107, 247, 0.2);
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.toast-container {
  position: fixed;
  top: 90px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1200;
  pointer-events: none;
}

.mt5-toast {
  background: var(--primary);
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 1rem;
  border-radius: 14px;
  min-width: 240px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mt5-toast.error {
  background: #dc2626;
  border-color: rgba(239, 68, 68, 0.75);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.28);
}

.mt5-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.skeleton-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-light);
  z-index: 1400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 110px 24px 24px;
  transition: opacity 0.35s ease;
}

body.theme-dark .skeleton-overlay {
  background: var(--bg-dark);
}

.skeleton-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.skeleton-frame {
  width: min(1100px, 92vw);
  display: grid;
  gap: 1rem;
}

.skeleton-line,
.skeleton-card,
.skeleton-block {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.45), rgba(148, 163, 184, 0.2));
  background-size: 200% 100%;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

body.theme-dark .skeleton-line,
body.theme-dark .skeleton-card,
body.theme-dark .skeleton-block {
  background: linear-gradient(90deg, rgba(71, 85, 105, 0.25), rgba(148, 163, 184, 0.2), rgba(71, 85, 105, 0.25));
}

.skeleton-line {
  height: 18px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.skeleton-card {
  height: 120px;
}

.skeleton-block {
  height: 220px;
}

.w-40 {
  width: 40%;
}

.w-35 {
  width: 35%;
}

.w-25 {
  width: 25%;
}

.w-50 {
  width: 50%;
}

@keyframes skeletonPulse {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

.chart-wrap {
  position: relative;
  min-height: 260px;
}

.chart-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.chart-filters .form-select,
.chart-filters .form-control {
  border-radius: 12px;
}

.chart-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.copy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.copy-card {
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid transparent;
  display: grid;
  gap: 0.75rem;
}

body.theme-light .copy-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border-light);
}

body.theme-dark .copy-card {
  background: rgba(20, 25, 37, 0.7);
  border-color: var(--border-dark);
}

.copy-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.copy-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.copy-card-meta-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.copy-card-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.copy-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.copy-filters {
  margin-bottom: 1rem;
}

.page-hero {
  gap: 1rem;
}

.portfolio-hero-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.portfolio-switch-form {
  flex-wrap: nowrap;
  align-items: center;
}

.portfolio-switch-form .form-select {
  min-width: 220px;
  width: auto;
  flex: 0 1 340px;
}

.section-card-header {
  flex-wrap: wrap;
}

.section-card-title {
  min-width: 0;
}

.section-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-card-note {
  display: inline-block;
}

.mt5-server-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

body.theme-light .mt5-server-results {
  background: #fff;
  border: 1px solid var(--border-light);
}

body.theme-dark .mt5-server-results {
  background: rgba(20, 25, 37, 0.98);
  border: 1px solid var(--border-dark);
}

body.theme-dark .mt5-server-results .list-group-item {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--border-dark);
}

body.theme-dark .mt5-server-results .list-group-item:hover {
  background: rgba(73, 107, 247, 0.15);
}

.modern-modal {
  border: none;
  border-radius: 18px;
  overflow: hidden;
}

.modern-modal .modal-header {
  background: linear-gradient(135deg, rgba(73, 107, 247, 0.08), transparent);
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}

.modern-modal .modal-body {
  background: rgba(255, 255, 255, 0.7);
}

.modern-modal .modal-footer {
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid var(--border-light);
}

body.theme-dark .modern-modal .modal-header {
  background: linear-gradient(135deg, rgba(73, 107, 247, 0.2), transparent);
  border-bottom-color: var(--border-dark);
}

body.theme-dark .modern-modal .modal-body,
body.theme-dark .modern-modal .modal-footer {
  background: rgba(12, 15, 22, 0.92);
  border-top-color: var(--border-dark);
}

.modal-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

body.theme-dark .modal-kicker {
  color: #c4dcff;
}

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

@media (max-width: 640px) {
  .page-shell {
    padding: 1rem !important;
  }

  .card.p-4 {
    padding: 1rem !important;
  }

  .card.p-3 {
    padding: 0.875rem !important;
  }

  .copy-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    align-items: flex-start !important;
  }

  .page-hero .badge {
    align-self: flex-start;
  }

  .portfolio-hero-actions,
  .portfolio-switch-form,
  .section-card-header,
  .section-card-actions {
    width: 100%;
  }

  .portfolio-hero-actions {
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start;
  }

  .portfolio-hero-actions form,
  .portfolio-switch-form,
  .portfolio-switch-form .form-select,
  .portfolio-switch-form .btn,
  .section-card-actions .btn {
    width: 100%;
  }

  .portfolio-switch-form .form-select {
    min-width: 0;
    flex: 1 1 100%;
  }

  .portfolio-switch-form {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .section-card-header {
    align-items: flex-start !important;
  }

  .section-card-title,
  .section-card-note,
  .section-card-actions span,
  .section-card-actions .btn {
    width: 100%;
  }

  .section-card-actions {
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .chart-filters,
  .copy-card-settings,
  .copy-card-meta {
    grid-template-columns: 1fr;
  }

  .copy-card-meta-inline {
    grid-template-columns: 1fr;
  }

  .copy-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-card-actions>* {
    width: 100%;
  }

  .navbar-brand {
    font-size: 17px;
  }

  table.dataTable tbody td.dt-control,
  table.dataTable tbody th.dt-control,
  table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,
  table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control {
    text-align: left !important;
    padding-left: 0.75rem !important;
    padding-right: 0.5rem !important;
  }

  table.dataTable tbody td.dt-control:before,
  table.dataTable tbody th.dt-control:before,
  table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,
  table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before {
    margin-right: 0.35rem;
  }

  .dataTables_wrapper .dataTables_paginate,
  .dt-paging {
    width: 100%;
    justify-content: center;
  }

  .dataTables_wrapper .dataTables_paginate .pagination,
  .dt-paging .pagination {
    width: 100%;
    justify-content: center;
  }
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.5rem;
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #dc3545 !important;
  background-image: none !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15) !important;
}

body.theme-light .form-control.is-invalid,
body.theme-light .form-select.is-invalid {
  background-color: rgba(220, 53, 69, 0.06) !important;
}

body.theme-dark .form-control.is-invalid,
body.theme-dark .form-select.is-invalid {
  background-color: rgba(220, 53, 69, 0.12) !important;
  color: var(--text-dark);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.password-toggle .material-icons {
  font-size: 20px;
}

body.theme-dark .password-toggle {
  color: #cbd5f5;
}

.password-toggle .fa-regular {
  font-size: 18px;
}

.dataTables_wrapper .dataTables_paginate .pagination,
.dt-paging .pagination {
  gap: 0.4rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_paginate,
.dt-paging {
  display: flex;
  justify-content: flex-end;
}

div.dt-container div.dt-processing {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dataTables_wrapper .page-link,
.dt-paging .page-link {
  border-radius: 999px !important;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-light);
}

.dt-paging .page-link.first,
.dt-paging .page-link.previous,
.dt-paging .page-link.next,
.dt-paging .page-link.last {
  position: relative;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.dt-paging .page-link.first::before,
.dt-paging .page-link.previous::before,
.dt-paging .page-link.next::before,
.dt-paging .page-link.last::before {
  font-size: 1.05rem;
  font-weight: 700;
  color: currentColor;
  line-height: 1;
}

.dt-paging .page-link.first::before {
  content: "↞";
}

.dt-paging .page-link.previous::before {
  content: "←";
}

.dt-paging .page-link.next::before {
  content: "→";
}

.dt-paging .page-link.last::before {
  content: "↠";
}

.dt-paging .page-link.previous:hover:not(:disabled),
.dt-paging .page-link.next:hover:not(:disabled),
.dt-paging .page-link.first:hover:not(:disabled),
.dt-paging .page-link.last:hover:not(:disabled) {
  transform: translateY(-1px);
}

.dt-paging .page-link.first::before {
  content: "\219E";
}

.dt-paging .page-link.previous::before {
  content: "\2190";
}

.dt-paging .page-link.next::before {
  content: "\2192";
}

.dt-paging .page-link.last::before {
  content: "\21A0";
}

body.theme-dark .dataTables_wrapper .page-link,
body.theme-dark .dt-paging .page-link {
  border-color: var(--border-dark);
  color: var(--text-dark);
}

.dataTables_wrapper .page-item.active .page-link,
.dt-paging .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.dataTables_wrapper .page-link:hover,
.dt-paging .page-link:hover {
  background: rgba(73, 107, 247, 0.15);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
  background-color: rgba(73, 107, 247, 0.07);
}

body.theme-dark .table-striped>tbody>tr:nth-of-type(odd)>* {
  background-color: #496cf70e;
}

.navbar-toggler {
  border: none;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.navbar-toggler:focus,
.navbar-toggler:focus-visible,
.paginate_button:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler:hover {
  transform: translateY(-1px);
  border-color: rgba(73, 107, 247, 0.6);
}

.navbar-toggler-icon {
  background-image: none;
  width: 22px;
  height: 2px;
  background-color: var(--primary);
  border-radius: 999px;
  position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background-color: var(--primary);
  border-radius: 999px;
  transition: transform 0.2s ease;
}

.navbar-toggler-icon::before {
  top: -7px;
}

.navbar-toggler-icon::after {
  top: 7px;
}

div.dataTables_wrapper div.dataTables_length select {
  width: 70px !important;
}

.dataTables_length {
  margin-bottom: 1rem !important;
}

@media (max-width: 991.98px) {
  .navbar .navbar-nav .nav-link {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
}
