/* ShowuAdmin color tone bindings. The selected tone token file is loaded after this file. */
:root {
  --tone-primary: #4154f1;
  --tone-strong: #012970;
  --tone-soft: #f3f6ff;
  --tone-rgb: 65, 84, 241;
  --tone-dark-primary: #6ea8fe;
  --tone-dark-strong: #91bdff;
  --tone-dark-soft: #182944;
  --showu-primary: var(--tone-dark-primary);
  --showu-primary-strong: var(--tone-dark-strong);
}

a,
.page-link,
.btn-link,
.profile .profile-card .social-links a,
.contact .info-box i {
  color: var(--tone-primary);
}

.text-primary {
  color: var(--tone-primary) !important;
}

a:hover,
.page-link:hover,
.btn-link:hover,
.profile .profile-card .social-links a:hover {
  color: var(--tone-strong);
}

.btn-primary,
.bg-primary,
.badge.bg-primary,
.back-to-top,
.page-item.active .page-link,
.form-check-input:checked {
  color: #fff !important;
  background-color: var(--tone-primary) !important;
  border-color: var(--tone-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.back-to-top:hover {
  color: #fff !important;
  background-color: var(--tone-strong) !important;
  border-color: var(--tone-strong) !important;
}

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

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

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.page-link:focus {
  border-color: var(--tone-primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(var(--tone-rgb), 0.18) !important;
}

.header-nav .theme-toggle:focus-visible,
.header-nav .color-tone-toggle:focus-visible,
.header-nav .font-size-toggle:focus-visible,
.header-nav .font-size-option:focus-visible,
.header-nav .tone-option:focus-visible {
  outline-color: rgba(var(--tone-rgb), 0.55) !important;
}

.header-nav .tone-option.active,
.header-nav .tone-option[aria-checked="true"],
.header-nav .font-size-option.active,
.header-nav .font-size-option[aria-checked="true"] {
  color: var(--tone-primary);
  background-color: var(--tone-soft);
}

.header-nav .font-size-preview {
  color: var(--tone-strong);
}

html:not([data-theme="dark"]) .header .toggle-sidebar-btn,
html:not([data-theme="dark"]) .header-nav .nav-icon,
html:not([data-theme="dark"]) .header-nav .nav-profile,
html:not([data-theme="dark"]) .header .search-form button i,
html:not([data-theme="dark"]) .pagetitle h1,
html:not([data-theme="dark"]) .card-title,
html:not([data-theme="dark"]) .profile .profile-card h2,
html:not([data-theme="dark"]) .contact .info-box h3,
html:not([data-theme="dark"]) .footer .copyright,
html:not([data-theme="dark"]) .footer .credits {
  color: var(--tone-strong) !important;
}

html:not([data-theme="dark"]) .sidebar-nav .nav-link:not(.collapsed),
html:not([data-theme="dark"]) .sidebar-nav .nav-link:hover,
html:not([data-theme="dark"]) .sidebar-nav .nav-content a:hover,
html:not([data-theme="dark"]) .sidebar-nav .nav-content a.active,
html:not([data-theme="dark"]) .nav-tabs-bordered .nav-link:hover,
html:not([data-theme="dark"]) .nav-tabs-bordered .nav-link:focus,
html:not([data-theme="dark"]) .nav-tabs-bordered .nav-link.active {
  color: var(--tone-primary) !important;
}

html:not([data-theme="dark"]) .sidebar-nav .nav-link:not(.collapsed),
html:not([data-theme="dark"]) .sidebar-nav .nav-link:hover,
html:not([data-theme="dark"]) .dropdown-menu .dropdown-item:hover,
html:not([data-theme="dark"]) .dropdown-menu .dropdown-item:focus {
  background-color: var(--tone-soft) !important;
}

html[data-theme="dark"] .header-nav .tone-option.active,
html[data-theme="dark"] .header-nav .tone-option[aria-checked="true"],
html[data-theme="dark"] .header-nav .font-size-option.active,
html[data-theme="dark"] .header-nav .font-size-option[aria-checked="true"],
html[data-theme="dark"] .sidebar-nav .nav-link:not(.collapsed),
html[data-theme="dark"] .sidebar-nav .nav-link:hover,
html[data-theme="dark"] .sidebar-nav .nav-content a:hover,
html[data-theme="dark"] .sidebar-nav .nav-content a.active {
  color: var(--tone-dark-strong) !important;
  background-color: var(--tone-dark-soft) !important;
}

/*
 * 側邊選單的目前功能（aria-current="page"）：與其他項目明顯區隔。
 * 不論第幾層一律主色實心底、白字（目錄內的功能另加粗體、白色圓點）；展開中的目錄只用淺底，與目前功能區隔。
 * 選擇器加上 .nav-item／li 以高於上方「展開中」的規則（同為 !important）。
 */
html .sidebar-nav .nav-item > .nav-link[aria-current="page"],
html .sidebar-nav .nav-item > .nav-link[aria-current="page"]:hover {
  color: #fff !important;
  background-color: var(--tone-primary) !important;
  box-shadow: 0 2px 6px rgba(var(--tone-rgb), 0.35);
}

html .sidebar-nav .nav-item > .nav-link[aria-current="page"] i {
  color: #fff !important;
}

html .sidebar-nav .nav-content li > a.active[aria-current="page"],
html .sidebar-nav .nav-content li > a.active[aria-current="page"]:hover {
  color: #fff !important;
  background-color: var(--tone-primary) !important;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(var(--tone-rgb), 0.35);
  font-weight: 700;
}

html .sidebar-nav .nav-content li > a.active[aria-current="page"] i {
  background-color: #fff;
}

html[data-theme="dark"] .sidebar-nav .nav-item > .nav-link[aria-current="page"],
html[data-theme="dark"] .sidebar-nav .nav-item > .nav-link[aria-current="page"]:hover {
  color: #0b1220 !important;
  background-color: var(--tone-dark-primary) !important;
  box-shadow: none;
}

html[data-theme="dark"] .sidebar-nav .nav-item > .nav-link[aria-current="page"] i {
  color: #0b1220 !important;
}

html[data-theme="dark"] .sidebar-nav .nav-content li > a.active[aria-current="page"],
html[data-theme="dark"] .sidebar-nav .nav-content li > a.active[aria-current="page"]:hover {
  color: #0b1220 !important;
  background-color: var(--tone-dark-primary) !important;
  box-shadow: none;
}

html[data-theme="dark"] .sidebar-nav .nav-content li > a.active[aria-current="page"] i {
  background-color: #0b1220;
}

html[data-theme="dark"] a,
html[data-theme="dark"] .page-link,
html[data-theme="dark"] .btn-link,
html[data-theme="dark"] .profile .profile-card .social-links a,
html[data-theme="dark"] .contact .info-box i {
  color: var(--tone-dark-primary);
}

html[data-theme="dark"] .text-primary {
  color: var(--tone-dark-primary) !important;
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] .page-link:hover,
html[data-theme="dark"] .btn-link:hover {
  color: var(--tone-dark-strong);
}
