/* ==========================================================================
   勤怠（js/attendance.js）。プレビュー docs/attendance/preview.html のデザイン。
   ボタン・タブ・表・小窓は経費精算（css/expense.css の exp-*）と同じ部品を使い、ここには勤怠だけのものを置く。
   ========================================================================== */

/* メニュー：「勤怠」は勤怠の対象外の人に、「勤怠の管理」は責任者・経営・経理以外の人に出さない */
body.att-exempt .sidebar-nav .nav-item[data-target="attendance"],
body:not(.att-admin) .sidebar-nav .nav-item[data-target="attendance-admin"] {
  display: none !important;
}
.att-admin-tag { font-size: 11.5px; font-weight: 500; color: var(--c-brand, #56693a); background: var(--c-brand-50, #f4f5ee); border-radius: 4px; padding: 2px 8px; vertical-align: middle; margin-left: 8px; }

/* 打刻 */
.att-punch { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 56px; align-items: start; }
.att-clock { border: 1px solid var(--exp-line); border-radius: 12px; padding: 24px 24px 20px; text-align: center; }
.att-date { color: var(--exp-muted); font-size: 13px; }
.att-time { font-size: 52px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.2; margin: 4px 0 18px; }
.att-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.att .att-big { height: 64px; font-size: 17px; letter-spacing: .2em; }
.att-now { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--exp-line); font-size: 13px; color: var(--exp-ink-2); }
.att-away { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.att-away .exp-btn { min-width: 120px; letter-spacing: .2em; }
.att-moving { margin-top: 12px; }
.att-timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--exp-line); }
.att-timeline li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--exp-line); font-size: 13.5px; align-items: center; }
.att-tm { font-variant-numeric: tabular-nums; font-weight: 500; }

/* 小窓の中：働く場所・いいえ／はい */
.att-where { background: #f8f7f5; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.att-ask { display: flex; flex-direction: column; gap: 8px; }
.att-ask label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #d1cbbe; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; color: #1c1a17; }
.att-ask label.on { border-color: #1c1a17; box-shadow: inset 0 0 0 1px #1c1a17; }
.att-ask label input { margin-top: 4px; accent-color: #1c1a17; width: auto !important; min-height: 0 !important; flex-shrink: 0; }
.att-ask-note { display: block; font-size: 12px; color: #736c60; }
.att-range { display: flex; align-items: center; gap: 8px; }
.att-range input { width: 90px !important; }
.att-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--exp-ink-2); }

/* 一覧 */
.att-nowrap { white-space: nowrap; }
.att-place { font-size: 12.5px; color: var(--exp-ink-2); }
.att-pins { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.att-pin { font: inherit; font-size: 12px; padding: 2px 8px; border: 1px solid var(--exp-line); border-radius: 999px; background: none; color: var(--exp-ink); cursor: pointer; white-space: nowrap; }
button.att-pin:hover { border-color: var(--exp-ink-2); }
.att-pin-none { cursor: default; color: var(--exp-ink-2); white-space: normal; }
.att-map { width: 100%; height: 340px; border: 0; border-radius: 8px; display: block; }
.att-move { font-size: 12px; color: var(--c-brand, #56693a); border: 1px solid #e2e9d7; border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.att-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.att-right { justify-content: flex-end; margin-top: 0; }
.att-days tr.att-today td { background: #f4f5ee; }
.att-allsel { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--exp-ink-2); white-space: nowrap; }
.att-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }

/* 全体の状況 */
.att-s { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.att-s::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--exp-faint); }
.att-s-work::before { background: var(--exp-ok); }
.att-s-move::before { background: var(--c-brand, #56693a); }
.att-s-left { color: var(--exp-muted); }
.att-s-none { color: var(--exp-unpaid); font-weight: 600; }
.att-s-none::before { background: var(--exp-unpaid); }
.att-meter { display: inline-block; width: 80px; height: 4px; background: var(--exp-line); border-radius: 2px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.att-meter b { display: block; height: 100%; background: var(--exp-ink); }
.att-meter.hot b { background: var(--exp-unpaid); }

/* 有給：使い始めの帯・自分の有給 */
.att-note { border-left: 2px solid var(--exp-wait); padding: 2px 0 2px 14px; margin-bottom: 24px; font-size: 13px; color: var(--exp-ink-2); }
.att-start { border: 1px solid #e2e9d7; background: #f4f5ee; border-radius: 10px; padding: 18px 20px; margin-bottom: 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; }
.att-start b { font-weight: 600; }
.att-start ol { margin: 6px 0 0; padding-left: 18px; color: var(--exp-ink-2); font-size: 13px; }
.att-start-count { text-align: right; white-space: nowrap; }
.att-leave-people td { white-space: nowrap; }
.att-leave-people td:nth-child(3) { white-space: normal; min-width: 170px; }
.att-leave-people .att-s { white-space: normal; }

/* 有給：使い始めの残りを入れる板（右から出る） */
.att-panel-bg { position: fixed; inset: 0; background: rgba(28, 26, 23,.32); z-index: 2000; }
.att-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 640px; max-width: 100%; background: #fff; box-shadow: -12px 0 40px -12px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.att-ph { padding: 22px 28px 16px; border-bottom: 1px solid var(--exp-line); }
.att-ph h3 { margin: 0; font-size: 17px; font-weight: 600; }
.att-pb { flex: 1; overflow-y: auto; padding: 22px 28px 28px; }
.att-pf { padding: 14px 28px; border-top: 1px solid var(--exp-line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.att-pf > span { flex: 1; }
.att-blk + .att-blk { margin-top: 30px; }
.att-blk h4 { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; }
.att-no { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; background: var(--exp-ink); color: #fff; font-size: 11.5px; margin-right: 8px; font-weight: 500; }
.att-blk > .exp-sub { margin: 0 0 12px 28px; }
.att-inner { margin-left: 28px; }
.att-panel input { border: 1px solid var(--exp-line-2); border-radius: 6px; padding: 5px 8px; min-height: 34px; font: inherit; outline: none; background: #fff; }
.att-panel input:focus { border-color: var(--exp-ink-2); }
.att-panel #lv-note { width: 100%; }
.att-panel .att-n { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.att-unit { font-size: 12.5px; color: var(--exp-ink-2); margin: 0 8px 0 4px; }
.att-lv-t td { padding: 10px 8px; }
.att-lv-t th { padding: 0 8px 8px; }
.att-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-bottom: 10px; }
.att-line > span:first-child { width: 190px; }
.att-calc { background: #f8f6f1; border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.att-cv { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.att-cv small { font-size: 12px; color: var(--exp-muted); margin-left: 2px; font-weight: 400; }

/* 利用権限マスターの勤怠の列（js/users.js） */
.user-att-col { background: #f7f9f3; white-space: nowrap; }
.user-att-col select { min-width: 68px; }
.user-att-col input[type="date"] { min-width: 132px; }
.user-att-auto { font-size: 10.5px; color: #a39c8e; font-weight: 400; }
.user-att-auto-cell { color: var(--c-brand, #56693a); font-weight: 600; }
.user-att-none { color: #c1beb9; font-weight: 400; }

@media (max-width: 1100px) {
  .att-punch, .att-two { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 760px) {
  .att-clock { padding: 18px 16px; }
  .att .att-big { height: 96px; font-size: 20px; }
  .att-start { grid-template-columns: 1fr; }
  .att-start-count { text-align: left; }
  .att-ph, .att-pb, .att-pf { padding-left: 16px; padding-right: 16px; }
  .att-blk > .exp-sub, .att-inner { margin-left: 0; }
  .att-calc { grid-template-columns: 1fr 1fr; }
  .att-line > span:first-child { width: 100%; margin-bottom: 4px; }
}

/* 有給・欠勤の印（自分の勤怠・1人の月） */
.att-off { font-size: 12px; color: var(--c-brand, #56693a); border: 1px solid #e2e9d7; border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.att-off-absent { color: var(--exp-ink-2); border-color: var(--exp-line-2); }

/* 時刻を選ぶ欄（時・分のプルダウン。パソコンもスマホも同じ） */
.att-time { display: inline-flex; align-items: center; gap: 4px; }
.att .att-time select, .exp-modal .att-time select, .att-time select { width: auto !important; min-width: 74px; padding-right: 22px; }
.att-range { flex-wrap: wrap; }

/* 1人の月（自分の勤怠・月の集計で社員を選んだとき） */
.att-mhead { gap: 14px; flex-wrap: wrap; }
.att-who { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; }
.att-who b { font-weight: 600; }
.att-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-brand-50, #f4f5ee); color: var(--c-brand, #56693a); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; }
.att-ymnav { display: inline-flex; align-items: center; gap: 4px; }
.att-ymnav .exp-btn { min-width: 32px; padding: 0 8px; font-size: 16px; line-height: 1; }
.att-ymnav .exp-btn:disabled { opacity: .35; cursor: default; }
.att-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.att-card { background: #fff; border: 1px solid var(--exp-line); border-radius: 10px; padding: 14px 16px 12px; border-top: 3px solid var(--exp-line-2, #e2e0db); }
.att-card .att-cl { font-size: 12px; color: var(--exp-muted); }
.att-card .att-cv { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 2px; line-height: 1.2; }
.att-card .att-cv small { font-size: 12px; font-weight: 400; color: var(--exp-muted); margin: 0 4px 0 2px; }
.att-card .att-cc { font-size: 12px; color: var(--exp-ink-2); min-height: 1.4em; }
.att-card-warn { border-top-color: var(--exp-wait, #8c542f); }
.att-card-hot { border-top-color: var(--exp-unpaid, #b55445); }
.att-card-hot .att-cv { color: var(--exp-unpaid, #b55445); }
.att-card-ok { border-top-color: var(--exp-ok, #2d7d48); }
.att-lvband { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; background: #f4f5ee; border: 1px solid #e2e9d7; border-radius: 10px; padding: 12px 18px; margin-bottom: 22px; }
.att-lvtitle { font-size: 12.5px; font-weight: 600; color: var(--c-brand, #56693a); }
.att-lvmain { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-brand, #56693a); margin-left: -12px; }
.att-lvmain small { font-size: 12px; font-weight: 400; margin: 0 4px 0 2px; }
.att-lvitem { display: flex; flex-direction: column; font-size: 12px; color: var(--exp-ink-2); padding-left: 18px; border-left: 1px solid #e2e9d7; }
.att-lvitem b { font-size: 14px; font-weight: 600; color: var(--exp-ink); font-variant-numeric: tabular-nums; }
.att-lvitem em { font-style: normal; font-size: 11.5px; color: var(--exp-muted); }
.att-lvband-empty { gap: 6px 16px; }
.att-days-wrap { border: 1px solid var(--exp-line); border-radius: 10px; background: #fff; }
.att-days { table-layout: fixed; }
.att-days th { background: #f8f6f1; }
.att-days td { vertical-align: middle; }
.att-days tr.att-offday td { background: #fdfcf9; color: var(--exp-muted); }
.att-days tr.att-today td { background: #f4f5ee; }
.att-dcell { display: flex; align-items: baseline; gap: 6px; }
.att-dn { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 20px; text-align: right; }
.att-wd { font-size: 12px; color: var(--exp-ink-2); }
.att-wd.att-sun { color: #b55445; }
.att-wd.att-sat { color: #56693a; }
.att-hm { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 14px; }
.att-chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #efece5; color: var(--exp-muted); }
.att-chip-none { background: #f8f1ec; color: #794928; }
.att-chip-now { background: #f3f6ef; color: var(--c-brand, #56693a); }
@media (max-width: 1100px) { .att-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .att-cards { grid-template-columns: 1fr 1fr; }
  .att-lvmain { margin-left: 0; }
  .att-lvitem { padding-left: 0; border-left: 0; }
  .att-days { table-layout: auto; }
}
