/* backend/app/web/assets/enterprise.css
   ============================================================
   企业族六页（login/manage/my + copilot/box/boxes）布局层（设计 §4.1/§9/§10）：
   只放结构与尺寸（顶 nav、tab 下划线、容器宽度、表格斑马、表单宽度、黏性页脚），
   禁止出现颜色字面量——深色 shadcn 语义见 tokens.css 的 html.theme-ent 作用域，
   本文件只消费 var(--...)。仅 dashboard（纯 kiosk 投屏页）不加载本文件。
   ============================================================ */

/* ---------- 顶栏：左 logo+字标 / 中平铺 nav / 右用户区（设计 §5） ---------- */
/* 高度 auto + min-height：单行时恒 56px（内容 34px 撑不到下限），
   769–1199 中档宽度内容换行时顶栏跟着长高而不是被 56px 裁掉 */
.theme-ent .topbar { height: auto; min-height: 56px; padding: 0 22px; display: flex; align-items: center; gap: 18px;
  border-bottom: 1px solid var(--border); }
.theme-ent .brand { flex: none; display: flex; align-items: center; gap: 14px; }
.theme-ent .brand-logo { height: 28px; width: auto; display: block; }
.theme-ent .update-info { margin-left: 18px; flex: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 中 nav 平铺（会话 | 管理 | 我的），不再有「视图▾」下拉；768px 以下横滑不折行。
   .update-info 撑满剩余宽度后，nav 以 flex:1 居中于"字标与用户区之间" */
.theme-ent .topnav { flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 4px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.theme-ent .topnav::-webkit-scrollbar { display: none; }
.theme-ent .topnav a { padding: 7px 14px; border-radius: 8px; }
.theme-ent .topnav a + a::before { display: none; }   /* 平铺 nav 不要竖线分隔 */
.theme-ent .topnav a.on::after { left: 14px; right: 14px; bottom: 2px; }

/* ---------- manage 五 tab（设计 §3）：页头下沿 sticky、横滑不折行、下划线活动态 ---------- */
.ent-tabs { position: sticky; top: 56px; z-index: 30; display: flex; align-items: center;
  gap: 8px; margin: 0 0 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.ent-tabs-scroll { display: flex; align-items: center; gap: 2px; flex: 1;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.ent-tabs-scroll::-webkit-scrollbar { display: none; }
.ent-tab { position: relative; flex: none; padding: 11px 12px; font-size: 13.5px; line-height: 1.2;
  color: var(--text-mid); background: none; border: 0; cursor: pointer;
  transition: color 160ms; }
.ent-tab:hover { color: var(--text-hi); }
.ent-tab.on { color: var(--text-hi); font-weight: 600; }
.ent-tab.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--brand); }
/* 未读角标：0 不画（JS 控制 hidden），数字用品牌绿底 + 深色字 */
.tab-badge { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; font-size: 10.5px; line-height: 16px; text-align: center;
  font-weight: 700; color: var(--c-substrate); background: var(--brand); }
/* 「更多▾」预留结构：超 6 个可见 tab 时把次级 tab 收进来（本期不满 6 个，默认 hidden） */
.ent-tabs-more { position: relative; flex: none; }
.ent-more-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px;
  padding: 6px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--sh-lift); z-index: 40; }

/* ============================================================
   K1 版权沉底（企业族六页统一，设计 §10）：body 至少一屏 + flex 列，主区 flex:1，
   版权行收尾 → 内容不足一屏恒贴视口底、超一屏随文档流（经典 sticky footer）。
   为什么放这里：六页结构一致，页内各抄一份必漂移；dashboard（唯一非企业页）不加载本文件。
   ============================================================ */
.theme-ent body { min-height: 100dvh; display: flex; flex-direction: column; }
.theme-ent body > main,
.theme-ent body > .frame,
.theme-ent body > .auth-wrap { flex: 1; }

/* ---------- 容器宽度（设计：manage 1200 / my 980 / 多箱 1400） ----------
   width:100% 是"铺满"的关键：body 是 column flex，main 带 margin:0 auto 时
   交叉轴 auto margin 会吞掉剩余空间、退化成 fit-content（1920 屏上内容只占 ~1030px，
   用户抱怨的"没铺满"就是这个）——显式给满宽再由 max-width 收口、auto 居中。 */
.theme-ent .page-main { width: 100%; max-width: 1200px; }
.theme-ent .page-main.is-narrow { max-width: 980px; }
/* .is-wide 已退役（W6）：唯一消费方 boxes.html 改 .is-full——卡片网格 auto-fill
   在 1760px 弹性上限内自然增列，不再需要 1400 专属档 */
/* 三模块页（W3+W4）：内容区铺满（Q8 裁决 1760px 弹性上限）——1920 屏上表格/卡片
   不再被 1200 挤成窄条。
   W7 宽屏分级（4K 适配）：3840 下 1760 会缩成中间一条，但**不取消上限**——表格/正文的
   一行扫视跨度过大会丢行、阅读疲劳。故按视口分级放宽，保留两侧留白：
     <2560 视口：1760（默认，回归零风险；2560 边界起吃下一档）
     ≥2560：2240（≈87% 视口；卡片网格 minmax(330px) 自然增列，表格不被拉伸变形）
     ≥3440：2880（≈84% 视口；2880/330 ≈ 8 列，卡片不变形）
   数值依据：330px 卡片 + 16px 间距的列数节奏；表格行宽 2880 仍在可扫视范围（<3000）。 */
.theme-ent .page-main.is-full { max-width: 1760px; }
@media (min-width: 2560px) {
  .theme-ent .page-main.is-full { max-width: 2240px; }
}
@media (min-width: 3440px) {
  .theme-ent .page-main.is-full { max-width: 2880px; }
}

/* 栅格密度两档（不新造断点体系，沿用现有 768px 家族口径向上补）：
   ≤1600 常规三列、≤1200 两列、≤768 一列——卡片页 auto-fill 之外需要显式密度的
   表格页/双形态页统一吃这两档，避免各页各写一套。 */
@media (max-width: 1600px) {
  .theme-ent .ag-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (max-width: 1200px) {
  .theme-ent .ag-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ---------- 表格/列表斑马与行高（行式 ag-item） ---------- */
.theme-ent .ag-item:nth-child(even) { background: var(--c-panel-deep); }
.theme-ent .ag-item { border-radius: 8px; }

/* ---------- 表单与控件尺寸（shadcn 的 34px 控件高度、8px 圆角） ---------- */
.theme-ent .ag-input, .theme-ent .ag-select, .theme-ent .ag-btn { min-height: 34px; }
.theme-ent .ag-btn.is-sm { min-height: 26px; }
.theme-ent .ag-card { border-radius: 8px; }
.theme-ent .modal-box { border-radius: 10px; }
.theme-ent .api-toast { border-radius: 8px; }
.theme-ent :focus-visible { outline-color: var(--c-ring); }   /* 焦点环走 token，不写颜色 */

/* ---------- 登录页（无 nav，只留品牌区） ---------- */
/* .auth-wrap 的高度由上方 K1 共享规则给（body flex 列 + flex:1）——
   这里不能再写 min-height:100vh，否则 100vh 主体 + 54px 页脚恒超一屏、页脚沉不下去 */
.theme-ent .auth-card { border-radius: 10px; }

/* ---------- 小屏（教室平板竖屏/手机）：中 nav 横滑、字标收起、表单堆叠 ---------- */
@media (max-width: 768px) {
  /* W3 导航扩到 8 项：窄屏必须折行让 nav 独占一行横滑（boxes 页既有口径提升为公共件），
     否则 .update-info 撑破视口出现横向滚动（768 屏实测溢出 100px） */
  .theme-ent .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 14px; row-gap: 6px; gap: 10px; }
  .theme-ent .update-info { flex: 1 1 100%; margin-left: 0; }
  .theme-ent .topnav { flex: 1 1 100%; justify-content: flex-start; }
  .theme-ent .topnav a { padding: 7px 10px; }
  .theme-ent .auth-name { display: none; }   /* 右区只留角色徽标 + 退出 */
  .theme-ent .page-main { padding: 16px 14px 6px; }
  .ent-tab { padding: 10px 10px; }
}
