/* 워크임팩트 — 컬쳐임팩트 브랜드 컬러: 네이비 #14375C · 코랄 #EE5A36 · 크림 #F2EBD5 */
:root {
  --navy: #14375C;
  --coral: #EE5A36;
  --cream: #F2EBD5;
  --bg: #FAF6EA;
  --card: #FFFFFF;
  --text: #1C2B3A;
  --sub: #6B7A8C;
  --line: #E5DCC8;
  --ok: #2E8B57;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .8s ease;
}

/* ── 18시 이후 저녁 테마 ── */
body.evening {
  --bg: #1B2F47;
  --card: #24405F;
  --text: #F2EBD5;
  --sub: #A9BBD0;
  --line: #34517A;
}
/* ── 07시 이전 / 22시 이후 가산 시간대 ── */
body.late {
  --bg: #14202F;
  --card: #1E3048;
  --text: #F2EBD5;
  --sub: #94A9C4;
  --line: #2E4667;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18px; letter-spacing: 1px; }
.brand-text span { font-size: 11px; color: #BCCBDD; letter-spacing: .5px; }
.userchip {
  background: var(--coral); color: #fff;
  padding: 6px 14px; border-radius: 999px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}

.banner {
  padding: 10px 16px; text-align: center; font-weight: 700; font-size: 14px;
  background: var(--coral); color: #fff;
}
.banner.evening-b { background: #3E5C82; }

.tabs {
  display: flex; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 60px; z-index: 19;
}
.tab {
  flex: 1; padding: 12px 4px; border: 0; background: none;
  font-size: 15px; font-weight: 600; color: var(--sub); cursor: pointer;
  border-bottom: 3px solid transparent; font-family: inherit;
}
.tab.on { color: var(--coral); border-bottom-color: var(--coral); }

main { max-width: 760px; margin: 0 auto; padding: 14px 14px 60px; }
.panel { display: none; }
.panel.on { display: block; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(20, 55, 92, .06);
}
.card h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.card h3 small { color: var(--sub); font-weight: 400; }
.hint { font-size: 13px; color: var(--sub); margin-bottom: 10px; }

/* 출퇴근 큰 시계 */
.clockwrap { text-align: center; padding: 24px 16px; }
.bigdate { font-size: 15px; color: var(--sub); }
.bigclock { font-size: 52px; font-weight: 800; letter-spacing: 2px; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.bigclock.timer { color: var(--coral); }
body.evening .bigclock.timer, body.late .bigclock.timer { color: #FF8A65; }
.timerlabel { font-size: 13px; font-weight: 700; color: var(--coral); margin-top: 8px; letter-spacing: 1px; }
body.evening .timerlabel, body.late .timerlabel { color: #FF8A65; }
.status { font-size: 15px; margin-bottom: 16px; color: var(--sub); min-height: 22px; }
.status b { color: var(--coral); }
/* 근무 유형 칩 (일반·행사·셋업·출장) */
.typechips { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tchip {
  padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--sub);
  font-weight: 700; font-size: 14px; font-family: inherit; transition: all .15s;
}
.tchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
body.evening .tchip.on, body.late .tchip.on { background: var(--cream); border-color: var(--cream); color: #14375C; }
.tchip.on[data-type="event"] { background: var(--coral); border-color: var(--coral); color: #fff; }
.tchip.on[data-type="setup"] { background: #C9A227; border-color: #C9A227; color: #fff; }
.tchip.on[data-type="trip"] { background: #2E8B57; border-color: #2E8B57; color: #fff; }
.typehint { font-size: 12.5px; color: var(--sub); margin-bottom: 14px; min-height: 17px; }
.st.wtype { background: var(--navy); color: #fff; }

.clockbtn {
  width: 100%; max-width: 340px; padding: 20px;
  font-size: 22px; font-weight: 800; font-family: inherit;
  border: 0; border-radius: 18px; cursor: pointer;
  background: var(--coral); color: #fff;
  box-shadow: 0 6px 16px rgba(238, 90, 54, .35);
  transition: transform .1s;
}
.clockbtn:active { transform: scale(.97); }
.clockbtn.working { background: var(--navy); box-shadow: 0 6px 16px rgba(20, 55, 92, .35); }
body.evening .clockbtn.working, body.late .clockbtn.working { background: #F2EBD5; color: #14375C; }
.clockbtn:disabled { opacity: .5; cursor: default; }

.breakrow {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px; font-size: 14px;
}
.breakrow small { color: var(--sub); }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: #B9C3CE; transition: .2s; cursor: pointer;
}
.slider::before {
  content: ""; position: absolute; width: 20px; height: 20px;
  left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s;
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.breaktimer {
  margin: 14px auto 0; max-width: 340px;
  padding: 12px; border-radius: 12px;
  background: rgba(46, 139, 87, .12); color: var(--ok);
  font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.breaktimer b { font-size: 20px; }
.breaktimer.done { background: rgba(238, 90, 54, .15); color: var(--coral); }
.breaktimer.away { background: rgba(201, 162, 39, .15); color: #A8860B; }
body.evening .breaktimer.away, body.late .breaktimer.away { background: rgba(242, 235, 213, .12); color: #E8C860; }
.switch input:checked + .slider.away { background: #C9A227; }
body.evening .breaktimer, body.late .breaktimer { background: rgba(242, 235, 213, .12); color: #7FD6A4; }
body.evening .breaktimer.done, body.late .breaktimer.done { color: #FF8A65; }

.todaysum {
  margin-top: 16px; display: flex; justify-content: center; gap: 18px;
  font-size: 14px; color: var(--sub); flex-wrap: wrap;
}
.todaysum b { color: var(--text); font-size: 16px; }

.alert { border-left: 5px solid var(--coral); font-size: 14px; }
.alert button { margin-top: 8px; }

/* 오늘 현황 보드 */
.board { display: flex; flex-direction: column; gap: 8px; }
.board .row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; background: rgba(20, 55, 92, .05);
  font-size: 14px;
}
body.evening .board .row, body.late .board .row { background: rgba(242, 235, 213, .08); }
.board .nm { font-weight: 700; min-width: 64px; }
.board .st { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st.working { background: var(--ok); color: #fff; }
.st.done { background: #8B97A5; color: #fff; }
.st.off { background: transparent; color: var(--sub); border: 1px solid var(--line); }
.st.leave { background: var(--coral); color: #fff; }
.board .tm { margin-left: auto; color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }

/* 월 이동 + 차트 */
.monthnav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.monthnav strong { font-size: 17px; min-width: 110px; text-align: center; }
.monthnav button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 13px;
}
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; margin: 0 auto; }
.monthtotal { text-align: center; font-size: 14px; color: var(--sub); margin-top: 8px; }
.monthtotal b { color: var(--coral); }

.rowhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rowhead h3 { margin: 0; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--sub); font-weight: 600; font-size: 12.5px; }
td.pend { color: var(--coral); font-weight: 700; }
tr.weekend td:first-child { color: var(--coral); }

/* 폼 */
.form { display: flex; flex-wrap: wrap; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); flex: 1 1 30%; min-width: 120px; }
.form label.wide { flex: 1 1 100%; }
.form input, .form select, .form textarea {
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: var(--card); color: var(--text);
}
.btnrow { flex: 1 1 100%; display: flex; gap: 8px; }
.mainbtn {
  padding: 12px 20px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--coral); color: #fff; font-weight: 700; font-size: 15px; font-family: inherit;
}
.ghostbtn {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--sub); font-weight: 600; font-size: 13px; font-family: inherit;
}

/* 잔여 카드 */
.balances { display: flex; gap: 12px; }
.bal { flex: 1; text-align: center; padding: 20px 10px; }
.ballabel { font-size: 13px; color: var(--sub); display: block; margin-bottom: 6px; }
.bal strong { font-size: 22px; }
.bal.annual strong { color: var(--coral); }
.bal.comp strong { color: var(--navy); }
body.evening .bal.comp strong, body.late .bal.comp strong { color: var(--cream); }
.bal small { display: block; margin-top: 6px; color: var(--sub); font-size: 12px; }

/* 리스트 */
.list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.list .item {
  padding: 10px 12px; border-radius: 10px; background: rgba(20, 55, 92, .05);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
body.evening .list .item, body.late .list .item { background: rgba(242, 235, 213, .08); }
.list .item .dt { color: var(--sub); font-size: 12.5px; }
.list .item .del { margin-left: auto; border: 0; background: none; color: var(--coral); cursor: pointer; font-size: 13px; font-family: inherit; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.badge.annual { background: var(--coral); }
.badge.comp { background: var(--navy); }
body.evening .badge.comp, body.late .badge.comp { background: #4A6B96; }
.badge.pending { background: #C9A227; }
.badge.approved { background: var(--ok); }
.badge.rejected { background: #8B97A5; }
.empty { color: var(--sub); font-size: 13.5px; padding: 6px 2px; }

.guide { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.55; }
.guide li { padding-left: 22px; position: relative; }
.guide li::before { content: "✓"; position: absolute; left: 0; color: var(--coral); font-weight: 800; }

/* 이름 등록 오버레이 */
.overlay {
  position: fixed; inset: 0; background: var(--navy);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.regbox {
  background: #fff; color: #1C2B3A; border-radius: 20px; padding: 28px 24px;
  width: 100%; max-width: 380px; text-align: center;
}
.regbox img { width: 84px; margin-bottom: 8px; }
.regbox h2 { color: var(--navy); letter-spacing: 1px; margin-bottom: 8px; }
.regbox p { font-size: 14px; color: #6B7A8C; margin-bottom: 14px; line-height: 1.5; }
.reg-existing { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.reg-existing button {
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--navy);
  background: #fff; color: var(--navy); font-weight: 700; cursor: pointer; font-size: 14px; font-family: inherit;
}
.reg-new { display: flex; flex-direction: column; gap: 10px; }
.reg-new input { padding: 12px; border: 1px solid #D5DCE4; border-radius: 12px; font-size: 16px; text-align: center; font-family: inherit; }
.regerr { color: var(--coral); font-size: 13px; margin-top: 10px; min-height: 18px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 200; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  max-width: 90vw; text-align: center;
}
body.evening .toast, body.late .toast { background: var(--coral); }

@media (max-width: 640px) {
  .bigclock { font-size: 42px; }
  .brand-text span { display: none; }
  .tabs { top: 56px; }
  .balances { flex-direction: column; }
  th, td { padding: 7px 4px; font-size: 12.5px; }
}
