/* ============================================================
   考勤排班模块 · 共享样式（view/v2/clock/attendance/ 各页面共用）
   Bootstrap 5 之上；设计令牌集中在 :root，浅色主题。
   2026-11-13 v2：整体视觉重做（软阴影 / 圆角 / 拖拽态），类名保持向后兼容。
   ============================================================ */
:root {
  --att-bg: #f5f6f8;
  --att-card: #ffffff;
  --att-line: #eceef1;
  --att-txt: #1f2329;
  --att-sub: #6b7280;
  --att-brand: #2563eb;
  --att-brand-soft: #eef4ff;
  --att-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
  --att-shadow-lg: 0 8px 30px rgba(16, 24, 40, .14);
  --att-radius: 12px;
}

/* ---------- 模块二级导航 ---------- */
.att-nav { display: flex; flex-wrap: wrap; gap: .3rem; margin: .9rem 0 1rem; padding: .3rem;
           background: var(--att-card); border: 1px solid var(--att-line); border-radius: 2rem;
           box-shadow: var(--att-shadow); width: fit-content; max-width: 100%; }
.att-nav-link { padding: .34rem 1rem; border-radius: 2rem; font-size: .85rem; font-weight: 500;
                color: var(--att-sub); text-decoration: none; transition: all .15s ease; }
.att-nav-link:hover { background: var(--att-brand-soft); color: var(--att-brand); }
.att-nav-link.active { background: var(--att-brand); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }

/* ---------- 卡片 ---------- */
.att-card { background: var(--att-card); border: 1px solid var(--att-line); border-radius: var(--att-radius);
            padding: 1.1rem 1.15rem; margin-bottom: 1rem; box-shadow: var(--att-shadow); }
.att-card h6 { font-weight: 700; margin-bottom: .8rem; color: var(--att-txt); letter-spacing: .01em; }
.att-card h6 i { color: var(--att-brand); }

/* ---------- 提示条 ---------- */
.att-tip { border-radius: 10px; padding: .55rem .95rem; font-size: .85rem; margin-bottom: .85rem;
           display: flex; align-items: center; gap: .5rem; }
.att-tip.green { background: #e8f7ee; color: #0f5132; border: 1px solid #bfe8cf; }
.att-tip.red   { background: #fdeef0; color: #842029; border: 1px solid #f5c6cb; }

/* ---------- 日历（v2 拖拽版） ---------- */
.sch-wrap { background: var(--att-card); border: 1px solid var(--att-line); border-radius: var(--att-radius);
            box-shadow: var(--att-shadow); padding: 1rem 1.1rem 1.2rem; }
.sch-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; }
.sch-month { font-size: 1.15rem; font-weight: 800; color: var(--att-txt); min-width: 108px; text-align: center; }
.sch-nav-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--att-line);
               background: #fff; color: var(--att-sub); display: inline-flex; align-items: center;
               justify-content: center; cursor: pointer; transition: all .15s; }
.sch-nav-btn:hover { border-color: var(--att-brand); color: var(--att-brand); background: var(--att-brand-soft); }
.sch-legend { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: .78rem; color: var(--att-sub); margin-left: auto; }
.sch-legend .lg { display: inline-flex; align-items: center; gap: .3rem; }
.sch-legend .lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.sch-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sch-cal .wd { text-align: center; font-size: .75rem; font-weight: 600; color: var(--att-sub); padding: 6px 0 8px; }
.sch-cal .wd.wend { color: #f59e0b; }
.sch-cell { min-height: 106px; border: 1.5px solid var(--att-line); border-radius: 10px; padding: 5px 6px;
            font-size: .74rem; background: #fff; cursor: pointer; overflow: hidden; position: relative;
            transition: border-color .12s, box-shadow .12s, background .12s; }
.sch-cell:hover { border-color: #c9d4e3; box-shadow: 0 2px 10px rgba(16, 24, 40, .08); }
.sch-cell.wend { background: #fafbfc; }
.sch-cell.out { background: #f6f7f9; opacity: .55; cursor: default; }
.sch-cell .d { font-weight: 700; color: var(--att-txt); display: inline-flex; align-items: center;
               justify-content: center; min-width: 22px; height: 22px; border-radius: 7px; }
.sch-cell.today { border-color: var(--att-brand); background: var(--att-brand-soft); }
.sch-cell.today .d { background: var(--att-brand); color: #fff; }
/* 拖拽悬停态 */
.sch-cell.drop-ok { border-color: var(--att-brand); border-style: dashed; background: var(--att-brand-soft);
                    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .15); }
.sch-cell.dragging-src { opacity: .4; }

/* 班次事件块：浅底 + 左色条（替代旧实色块） */
.sch-ev { border-radius: 6px; padding: 2px 5px 2px 7px; margin-top: 3px; white-space: nowrap;
          overflow: hidden; text-overflow: ellipsis; cursor: grab; position: relative;
          border-left: 3px solid transparent; font-weight: 500; line-height: 1.5;
          transition: transform .12s, filter .12s; }
.sch-ev:hover { filter: brightness(.97); transform: translateY(-1px); }
.sch-ev:active { cursor: grabbing; }
.sch-ev small { font-weight: 400; opacity: .8; margin-left: 3px; }
.sch-more { font-size: .7rem; color: var(--att-sub); padding-left: 4px; margin-top: 2px; cursor: pointer; }
.sch-more:hover { color: var(--att-brand); }
.sch-ev-t { font-weight: 600; }
.sch-cal.can-edit .sch-cell { cursor: pointer; }
.sch-scope { font-size: .78rem; color: var(--att-brand); background: var(--att-brand-soft);
             border-radius: 2rem; padding: .15rem .6rem; }
.sch-foot { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--att-sub);
            margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--att-line); }
.sch-body { position: relative; }
.sch-lock { position: absolute; inset: 34px 0 0; z-index: 3; display: flex; flex-direction: column;
            align-items: center; justify-content: center; gap: .3rem; border-radius: 10px;
            background: rgba(255, 255, 255, .72); text-align: center; }
.sch-lock i { font-size: 2.1rem; color: #c7d0dc; }
.sch-lock b { font-size: .98rem; color: var(--att-txt); }
.sch-lock small { font-size: .78rem; color: var(--att-sub); }

/* ---------- 左侧部门栏（排班页主结构） ---------- */
.sch-page { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 1rem; align-items: start; }
.sch-depts { background: var(--att-card); border: 1px solid var(--att-line); border-radius: var(--att-radius);
             box-shadow: var(--att-shadow); padding: .55rem; position: sticky; top: 3.4rem; }
.dept-head { display: flex; align-items: center; font-size: .78rem; font-weight: 700; color: var(--att-sub);
             padding: .3rem .35rem .5rem; letter-spacing: .03em; }
.dept-list { display: flex; flex-direction: column; gap: 2px; max-height: 58vh; overflow: auto; }
.dept-item { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; cursor: pointer;
             border: 1px solid transparent; background: transparent; border-radius: 9px; padding: .45rem .45rem;
             transition: background .13s, border-color .13s; }
.dept-item:hover { background: #f8fafc; }
.dept-item.on { background: var(--att-brand-soft); border-color: #c7dbff; }
.dept-ico { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
            background: #eef1f5; color: #64748b; font-size: .8rem; transition: all .13s; }
.dept-item.on .dept-ico { background: var(--att-brand); color: #fff; }
.dept-name { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; line-height: 1.2;
             color: var(--att-txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-item.on .dept-name { color: var(--att-brand); font-weight: 700; }
.dept-name small { font-size: .69rem; color: var(--att-sub); font-weight: 400; margin-top: 2px; }
.dept-n { margin-left: auto; flex: none; font-size: .7rem; color: var(--att-sub); background: #f1f3f5;
          border-radius: 6px; padding: .05rem .3rem; }
.dept-none { font-size: .76rem; color: var(--att-sub); padding: .8rem .5rem; line-height: 1.5;
             display: flex; gap: .35rem; }
.dept-foot { margin-top: .5rem; padding: .45rem .5rem; border-top: 1px solid var(--att-line);
             font-size: .74rem; color: var(--att-sub); line-height: 1.4; }
@media (max-width: 900px) {
  .sch-page { grid-template-columns: 1fr; }
  .sch-depts { position: static; }
  .dept-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .dept-item { width: auto; }
  .dept-n { margin-left: 0; }
}


/* ---------- 排班弹层：人员双栏（左可选 → 右已排，拖拽） ---------- */
.pk { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pk-col { border: 1px solid var(--att-line); border-radius: 10px; overflow: hidden;
          display: flex; flex-direction: column; background: #fff; }
.pk-head { display: flex; flex-direction: column; gap: .35rem; padding: .45rem .6rem;
           background: #fafbfc; border-bottom: 1px solid var(--att-line);
           font-size: .82rem; font-weight: 600; color: var(--att-txt); }
.pk-title { display: flex; align-items: center; gap: .4rem; }
.pk-head b { color: var(--att-brand); }
.pk-search { width: 100%; max-width: none; height: 30px; font-size: .78rem; }
.sch-pick-head { display: flex; align-items: baseline; gap: .5rem; margin: 1rem 0 .35rem;
                 font-size: .85rem; font-weight: 700; color: var(--att-txt); }
.sch-pick-head small { font-weight: 400; color: var(--att-sub); font-size: .76rem; }

/* 同日重复排班开关（花名册头部） */
.mini-sw { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 500;
           color: var(--att-sub); cursor: pointer; user-select: none; margin-left: auto;
           border: 1px solid var(--att-line); background: #fff; border-radius: 2rem; padding: .1rem .45rem; }
.mini-sw .k { width: 24px; height: 13px; border-radius: 8px; background: #d6dbe3; position: relative;
              flex: none; transition: background .15s; }
.mini-sw .k::after { content: ''; position: absolute; top: 2px; left: 2px; width: 9px; height: 9px;
                     border-radius: 50%; background: #fff; transition: left .15s; }
.mini-sw.on { border-color: #bfe8cf; background: #f2fbf5; color: #0f5132; font-weight: 600; }
.mini-sw.on .k { background: #16a34a; }
.mini-sw.on .k::after { left: 13px; }
.mini-sw.disabled { opacity: .6; pointer-events: none; }

/* 已排标注 */
.att-member.is-busy { opacity: .66; }
.att-member.is-busy:hover { opacity: 1; }
.tag-busy { background: #fdeef0; color: #b42318; border-radius: .3rem; padding: 0 .3rem; font-size: .66rem;
            font-weight: 700; margin-left: .1rem; white-space: nowrap; }

.pk-list { padding: .45rem .5rem; min-height: 180px; max-height: 320px; overflow: auto; }
.pk-drop { background: #fcfdff; }
.pk-over { background: var(--att-brand-soft); outline: 2px dashed var(--att-brand); outline-offset: -4px; }
.pk-grp { font-size: .72rem; font-weight: 700; color: var(--att-sub); margin: .4rem .1rem .15rem;
          display: flex; align-items: center; gap: .35rem; }
.pk-grp span { background: #f1f3f5; border-radius: 6px; padding: 0 .3rem; font-weight: 500; }
.pk-empty { color: var(--att-sub); font-size: .8rem; text-align: center; padding: 3.4rem 0; }
@media (max-width: 640px) { .pk { grid-template-columns: 1fr; } }

/* ---------- 人员面板 ---------- */
.att-member { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--att-line);
              border-radius: 2rem; padding: .22rem .75rem .22rem .28rem; margin: .18rem; font-size: .82rem;
              cursor: pointer; background: #fff; transition: all .13s; user-select: none; }
.att-member:hover { border-color: #c9d4e3; background: #f8faff; box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.att-member[draggable="true"] { cursor: grab; }
.att-member[draggable="true"]:active { cursor: grabbing; }
.att-member.dragging-src { opacity: .4; }
.att-member .dot { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; flex: none;
                   box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.att-member.picked { border-color: var(--att-brand); background: var(--att-brand-soft); }
.att-member .badge-soft { font-size: .72rem; }
.sch-side { position: sticky; top: 3.2rem; }
.sch-hint { font-size: .78rem; color: var(--att-sub); background: var(--att-brand-soft);
            border-radius: 8px; padding: .45rem .7rem; margin-bottom: .6rem; }
.att-picked { border: 1.5px dashed #c9d4e3; border-radius: 10px; padding: .5rem; min-height: 2.6rem;
              background: #fafbfc; }
.att-picked.over { border-color: var(--att-brand); background: var(--att-brand-soft); }

/* ---------- 表格 ---------- */
.att-table { width: 100%; font-size: .85rem; }
.att-table th { font-weight: 600; color: var(--att-sub); white-space: nowrap; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.att-table td, .att-table th { padding: .5rem .55rem; border-bottom: 1px solid var(--att-line); vertical-align: middle; }

/* ---------- 弹层（不依赖 bootstrap.bundle，纯 Vue 控制） ---------- */
.att-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
            z-index: 1050; display: flex; align-items: flex-start; justify-content: center;
            padding: 5vh 1rem; overflow: auto; }
.att-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
             padding: 1.25rem 1.35rem; box-shadow: var(--att-shadow-lg); animation: att-pop .18s ease; }
@keyframes att-pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.att-modal h6 { font-weight: 700; margin-bottom: .9rem; font-size: 1.02rem; }
.att-modal .fl { font-size: .8rem; font-weight: 600; color: var(--att-sub); margin: .6rem 0 .25rem; }
/* 只读字段（日期 / 归属部门：由日历点击位置与左栏部门决定，不可改） */
.ro-field { display: flex; align-items: center; gap: .4rem; height: 31px; padding: .2rem .55rem;
            border: 1px dashed #dfe3e8; border-radius: 8px; background: #fafbfc;
            font-size: .84rem; font-weight: 600; color: var(--att-txt);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-field i { color: #9aa4b2; font-size: .78rem; flex: none; }
/* 尺寸：xl = 1140（排班表单）；day = 日期动作小窗 */
.att-mask .att-modal.modal-xl { max-width: 1140px; padding: 1.35rem 1.6rem 1.5rem; }
.att-mask .att-modal.modal-day { max-width: 460px; }
.att-mask .att-modal.modal-xl .pk-list { max-height: 380px; }
.att-mask .att-modal.modal-xl .pk-empty { padding: 6rem 0; }

/* 日期动作小窗 */
.day-act { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .1rem 0 .7rem; }
.day-act-btn { display: flex; align-items: center; gap: .6rem; text-align: left; cursor: pointer;
               border: 1.5px solid var(--att-line); background: #fff; border-radius: 12px;
               padding: .7rem .8rem; transition: all .13s; }
.day-act-btn:hover { border-color: #c9d4e3; background: #f8faff; transform: translateY(-1px); }
.day-act-btn.primary { border-color: #c7dbff; background: var(--att-brand-soft); }
.day-act-btn i { font-size: 1.35rem; color: var(--att-brand); flex: none; }
.day-act-btn b { display: block; font-size: .9rem; color: var(--att-txt); }
.day-act-btn small { font-size: .73rem; color: var(--att-sub); }
.day-list { border-top: 1px solid var(--att-line); padding-top: .3rem; max-height: 44vh; overflow: auto; }
.day-row { display: flex; align-items: center; gap: .55rem; padding: .5rem .45rem; border-radius: 9px;
           cursor: pointer; }
.day-row:hover { background: #f8faff; }
.day-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.day-main { min-width: 0; flex: 1; }
.day-t { font-size: .86rem; font-weight: 600; color: var(--att-txt); }
.day-s { font-size: .75rem; color: var(--att-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-team { font-size: .72rem; color: var(--att-sub); background: #f1f3f5; border-radius: 6px;
            padding: .05rem .35rem; flex: none; }


/* 班次类型分段选择 */
.sch-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #f1f3f5;
           border-radius: 10px; padding: 4px; }
.sch-seg button { border: 0; background: transparent; border-radius: 8px; padding: .42rem .3rem;
                  font-size: .82rem; color: var(--att-sub); cursor: pointer; font-weight: 500; transition: all .13s; }
.sch-seg button.on { background: #fff; color: var(--att-txt); font-weight: 700; box-shadow: 0 1px 6px rgba(16,24,40,.12); }

/* ---------- 打卡终端（竖屏手机） ---------- */
.punch-wrap { max-width: 430px; margin: 0 auto; }
.punch-btn { width: 100%; padding: 1rem; font-size: 1.15rem; border-radius: 1rem; }
.punch-sched { border: 2px solid var(--att-line); border-radius: .8rem; padding: .7rem .9rem;
               margin-bottom: .6rem; cursor: pointer; background: #fff; transition: all .13s; }
.punch-sched.picked { border-color: var(--att-brand); background: var(--att-brand-soft); }
.punch-tag { font-size: .72rem; border-radius: .35rem; padding: .05rem .45rem; color: #fff; }

/* ---------- 通用小件 ---------- */
.badge-soft { background: #f1f3f5; color: var(--att-sub); border-radius: .35rem; padding: .1rem .45rem; font-size: .75rem; }
.text-brand { color: var(--att-brand); }
.btn-att { background: var(--att-brand); border: 0; color: #fff; font-weight: 600; border-radius: 10px; }
.btn-att:hover { background: #1d4ed8; color: #fff; }
.btn-ghost { border: 1px solid var(--att-line); background: #fff; color: var(--att-sub); border-radius: 10px; }
.btn-ghost:hover { border-color: #c9d4e3; color: var(--att-txt); background: #fafbfc; }

/* 保留旧日历类名（兼容未重做页面） */
.att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.att-cal .wd { text-align: center; font-size: .75rem; color: var(--att-sub); padding: 4px 0; }
.att-cal .cell { min-height: 84px; border: 1px solid var(--att-line); border-radius: 6px; padding: 4px;
                 font-size: .72rem; background: #fff; cursor: pointer; overflow: hidden; }
.att-cal .cell.out { background: #f8f9fa; color: #ced4da; }
.att-cal .cell .d { font-weight: 600; }
.att-ev { border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden;
          text-overflow: ellipsis; color: #fff; }
