/* ===========================================================
   信创化智慧小区视频管控平台 - 自定义样式覆盖
   基于 Tabler UI (Bootstrap 5)
   =========================================================== */

:root {
  --zhsq-primary: #2563eb;
  --zhsq-sidebar-bg: #1b2a4a;
  --zhsq-sidebar-active: #2f6fed;
  --zhsq-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --zhsq-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ---------- 登录页渐变背景 ---------- */
.zhsq-login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1b2a4a 0%, #2563eb 60%, #1e3a8a 100%);
  background-attachment: fixed;
}

.zhsq-login-body .page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.zhsq-login-logo {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.zhsq-login-title {
  color: #fff;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.zhsq-login-body .text-muted {
  color: rgba(255, 255, 255, 0.7) !important;
}

.zhsq-login-body .hr-text {
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- 卡片阴影 ---------- */
.card.shadow-sm,
.shadow-sm {
  box-shadow: var(--zhsq-shadow) !important;
}

.card {
  box-shadow: var(--zhsq-shadow);
}

/* ---------- 表格悬停增强 ---------- */
.table-hover tbody tr {
  transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.04);
}

.table-card .table > :not(caption) > * > * {
  padding: 0.6rem 0.75rem;
}

/* ---------- 侧边栏 ---------- */
.zhsq-sidebar {
  background: var(--zhsq-sidebar-bg) !important;
}

.zhsq-brand {
  color: #fff !important;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* 品牌 Logo 图片 */
.navbar-brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.zhsq-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: 0.375rem;
  margin: 0.15rem 0.5rem;
  transition: all 0.15s ease;
}

.zhsq-sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* 侧边栏激活项高亮 */
.zhsq-sidebar .nav-link.active,
.zhsq-sidebar .nav-item.active > .nav-link {
  color: #fff !important;
  background: var(--zhsq-sidebar-active);
  font-weight: 500;
}

.zhsq-sidebar .nav-link-icon {
  color: inherit;
}

.zhsq-sidebar .nav .nav-link {
  font-size: 0.875rem;
}

/* 二级菜单缩进 + 层级感 */
.zhsq-sidebar .nav-item-child > .nav-link {
  padding-left: 2.25rem !important;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
}

.zhsq-sidebar .nav-children-indent .nav-link {
  padding-left: 2.25rem !important;
}

/* 折叠组展开/收起箭头 */
.zhsq-sidebar .nav-item > .nav-link[data-bs-toggle="collapse"]::after {
  content: '\F282'; /* bi-chevron-down */
  font-family: "bootstrap-icons";
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
  opacity: 0.7;
}

.zhsq-sidebar .nav-item > .nav-link[data-bs-toggle="collapse"][aria-expanded="true"]::after {
  transform: rotate(-180deg);
}

/* 顶栏 */
.zhsq-topbar {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---------- Toast 容器 ---------- */
.zhsq-toast-container {
  z-index: 1080;
  position: fixed !important;
  top: 1rem;
  right: 1rem;
  max-width: 360px;
}

.zhsq-toast {
  min-width: 280px;
  margin-bottom: 0.5rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left-width: 4px;
  box-shadow: var(--zhsq-shadow-lg);
  border-radius: 0.375rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.zhsq-toast.toast-success { border-left-color: #2fb344; }
.zhsq-toast.toast-info { border-left-color: #4299e1; }
.zhsq-toast.toast-warning { border-left-color: #f76707; }
.zhsq-toast.toast-danger { border-left-color: #d63939; }

.zhsq-toast.hide {
  opacity: 0;
  transform: translateX(12px);
}

/* ---------- 模态框 ---------- */
.zhsq-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.zhsq-modal-wrapper .modal {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: auto;
}

.zhsq-modal-wrapper .modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.5);
}

.zhsq-modal-wrapper .modal-dialog {
  margin: 0;
}

.zhsq-modal-wrapper .modal-content {
  box-shadow: var(--zhsq-shadow-lg);
  border: 0;
}

.zhsq-modal-wrapper .modal.fade.show {
  animation: zhsq-modal-in 0.18s ease;
}

@keyframes zhsq-modal-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 树形组件 ---------- */
.zhsq-tree,
.zhsq-tree .zhsq-tree-children {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.zhsq-tree-node {
  margin: 0.1rem 0;
}

.zhsq-tree-row {
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease;
}

.zhsq-tree-row:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

.zhsq-tree-toggle {
  width: 1.1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #6c7a91;
}

.zhsq-tree-label {
  font-size: 0.9rem;
}

.cursor-pointer {
  cursor: pointer;
}

/* ---------- 分页 ---------- */
.zhsq-tree .btn-group-sm > .btn {
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}

/* ---------- 工具类 ---------- */
.required::after {
  content: " *";
  color: #d63939;
}

.subavatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.page-title {
  font-weight: 600;
  margin-bottom: 0;
}

/* ===========================================================
   科技感仪表盘（Dashboard）
   =========================================================== */
.zhsq-dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  background: linear-gradient(120deg, #0f1c3d 0%, #173a8a 55%, #2563eb 100%);
  color: #fff;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.28);
}
.zhsq-dash-hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -8%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  pointer-events: none;
}
.zhsq-dash-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  mask-image: radial-gradient(circle at 80% 20%, #000 0%, transparent 70%);
}
.zhsq-dash-hero .hero-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  position: relative;
  z-index: 1;
}
.zhsq-dash-hero .hero-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}
.zhsq-dash-hero .hero-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
}

/* 科技感统计卡片 */
.zhsq-stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 0.75rem;
  background: linear-gradient(160deg, #ffffff 0%, #f4f7ff 100%);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.zhsq-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.16);
}
.zhsq-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-gradient, linear-gradient(90deg, #2563eb, #7c3aed));
}
.zhsq-stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, var(--stat-c1, #2563eb), var(--stat-c2, #7c3aed));
  box-shadow: 0 6px 16px var(--stat-glow, rgba(37, 99, 235, 0.35));
}
.zhsq-stat-card .stat-label {
  color: #64748b;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}
.zhsq-stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  color: #0f1c3d;
  font-variant-numeric: tabular-nums;
}
.zhsq-stat-card .stat-trend {
  font-size: 0.72rem;
  color: #94a3b8;
}
