/* Utlra 控制台主题（与落地页 v6 / 登录页同一套：纯黑 + 暖白 + logo 紫）
   auth.js 在所有应用页面给 <html> 加 utra-ui；覆盖应用的主题变量，
   无论应用当前是浅色还是深色模式都统一成黑色。 */

html.utra-ui,
html.utra-ui.light,
html.utra-ui.dark,
html.utra-ui[data-theme-preset] {
  color-scheme: dark !important;
  --background: #000 !important;
  --foreground: #ece8e1 !important;
  --card: #0a0a0a !important;
  --card-foreground: #ece8e1 !important;
  --popover: #0d0d0d !important;
  --popover-foreground: #ece8e1 !important;
  --primary: #ece8e1 !important;
  --primary-foreground: #000 !important;
  --secondary: #151515 !important;
  --secondary-foreground: #ece8e1 !important;
  --muted: #121212 !important;
  --muted-foreground: #8b8780 !important;
  --accent: #161616 !important;
  --accent-foreground: #ece8e1 !important;
  --border: rgba(236, 232, 225, .1) !important;
  --input: rgba(236, 232, 225, .14) !important;
  --ring: #8a83ff !important;
  --radius: 4px !important;

  --sidebar: #000 !important;
  --sidebar-foreground: #a19d96 !important;
  --sidebar-primary: #ece8e1 !important;
  --sidebar-primary-foreground: #000 !important;
  --sidebar-accent: #121212 !important;
  --sidebar-accent-foreground: #ece8e1 !important;
  --sidebar-border: rgba(236, 232, 225, .08) !important;
  --sidebar-ring: #8a83ff !important;

  --chart-1: #8a83ff !important;
  --chart-2: #ece8e1 !important;
  --chart-3: #6fbf9a !important;
  --chart-4: #cfc2a4 !important;
  --chart-5: #67645f !important;

  --success: #6fbf9a !important;
  --info: #8a83ff !important;
  --warning: #d9b46a !important;
  --neutral: #67645f !important;
  --destructive: #e0614c !important;

  --skeleton-base: #0f0f0f !important;
  --skeleton-highlight: #1a1a1a !important;
  --data-table-card-bg: #0a0a0a !important;

  background: #000 !important;
}

html.utra-ui body {
  background: #000 !important;
  color: #ece8e1;
  -webkit-font-smoothing: antialiased;
}
html.utra-ui ::selection { background: #8a83ff; color: #fff; }

/* 滚动条 */
html.utra-ui ::-webkit-scrollbar { width: 10px; height: 10px; }
html.utra-ui ::-webkit-scrollbar-track { background: transparent; }
html.utra-ui ::-webkit-scrollbar-thumb { background: #1c1c1c; border: 2px solid #000; border-radius: 6px; }
html.utra-ui ::-webkit-scrollbar-thumb:hover { background: #2a2a2a; }

/* 卡片与面板：去掉投影，靠细线分层 */
html.utra-ui #root [data-slot="card"],
html.utra-ui #root .shadow-sm,
html.utra-ui #root .shadow,
html.utra-ui #root .shadow-md {
  box-shadow: none !important;
}

/* 主内容区外框（应用用白底圆角容器包住页面） */
html.utra-ui #root main,
html.utra-ui #root [data-slot="sidebar-inset"] {
  background: #000 !important;
}

/* 表格 */
html.utra-ui #root table thead th {
  font-size: 11.5px; letter-spacing: .04em; color: #8b8780 !important; font-weight: 500;
}
html.utra-ui #root table tbody tr:hover { background: #0d0d0d !important; }

/* 按钮：主按钮象牙白、直角收敛 */
html.utra-ui #root [data-slot="button"] { border-radius: 4px !important; box-shadow: none !important; }

/* 输入框 */
html.utra-ui #root input,
html.utra-ui #root textarea,
html.utra-ui [data-slot="select-trigger"] {
  background: transparent !important;
  box-shadow: none !important;
}
html.utra-ui #root input::placeholder,
html.utra-ui #root textarea::placeholder { color: #4d4b47 !important; }
html.utra-ui #root input:-webkit-autofill {
  -webkit-text-fill-color: #ece8e1 !important;
  -webkit-box-shadow: 0 0 0 1000px #000 inset !important;
}

/* 弹窗、下拉、遮罩 */
html.utra-ui [data-slot="dialog-overlay"],
html.utra-ui [data-slot="sheet-overlay"],
html.utra-ui [data-slot="alert-dialog-overlay"] {
  background: rgba(0, 0, 0, .72) !important;
  backdrop-filter: blur(4px);
}
html.utra-ui [data-slot="dialog-content"],
html.utra-ui [data-slot="sheet-content"],
html.utra-ui [data-slot="alert-dialog-content"],
html.utra-ui [data-slot="popover-content"],
html.utra-ui [data-slot="dropdown-menu-content"],
html.utra-ui [data-slot="select-content"] {
  background: #0d0d0d !important;
  border: 1px solid rgba(236, 232, 225, .12) !important;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9) !important;
}

/* 代码高亮跟随深色 */
html.utra-ui .shiki,
html.utra-ui .shiki span { background-color: transparent !important; }

/* 顶栏 logo：换成和首页一致的方块 U 标志 */
html.utra-ui #root img[src*="/branding/unleash-mark"] {
  content: url(/branding/auth/mark.svg);
  object-fit: contain !important;
  border-radius: 0 !important;
  padding: 3px;
  background: transparent !important;
}

/* 头像：应用按用户名随机上色，统一成象牙白底黑字 */
html.utra-ui .group\/avatar > span {
  background: #ece8e1 !important;
  color: #000 !important;
}
html.utra-ui .group\/avatar::after { border-color: transparent !important; }

/* 徽标 / 标签：去掉应用自带的蓝色系，跟随主题 */
html.utra-ui #root [data-slot="badge"] {
  border-radius: 3px !important;
  border-color: rgba(236, 232, 225, .14) !important;
}
html.utra-ui #root .text-blue-500,
html.utra-ui #root .text-blue-600,
html.utra-ui #root .text-sky-500,
html.utra-ui #root .text-primary { color: #8a83ff !important; }
html.utra-ui #root .bg-blue-500,
html.utra-ui #root .bg-blue-600 { background-color: #8a83ff !important; }
html.utra-ui #root .bg-blue-50,
html.utra-ui #root .bg-blue-100,
html.utra-ui #root .bg-sky-50 { background-color: rgba(138, 131, 255, .1) !important; }

/* 顶栏品牌名旁的版本号（v1.0.0-rc.xx）不对外显示 */
html.utra-ui #root span.max-w-32.truncate.font-mono.text-xs { display: none !important; }
