/* Third House Chấm Công – staff app */
:root {
	--navy: #212C37;
	--beige: #F3F1EC;
	--sage: #7A8471;
	--caramel: #B97D3E;
	--red: #B4473C;
	--ink: #212C37;
	--muted: #6B7178;
	--line: #E2DED5;
	--card: #FFFFFF;
}
.thcc-body { margin: 0; background: var(--beige); }
#thcc-app, #thcc-app * { box-sizing: border-box; }
#thcc-app {
	font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--ink);
	font-size: 15px;
	line-height: 1.45;
	max-width: 520px;
	margin: 0 auto;
	min-height: 100vh;
	background: var(--beige);
	-webkit-font-smoothing: antialiased;
}
#thcc-app.thcc-embedded { min-height: 0; border-radius: 16px; overflow: hidden; }
.thcc-loading { padding: 40vh 0; text-align: center; color: var(--muted); }

/* brand */
.thcc-brand { text-align: center; }
.thcc-brand img { width: 240px; max-width: 70%; height: auto; display: inline-block; }
.thcc-head-logo { display: block; width: 110px; height: auto; margin-bottom: 14px; opacity: .95; }

/* login */
.thcc-login { padding: 12vh 24px 40px; }
.thcc-login h1 { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 3px; margin: 28px 0 20px; color: var(--navy); }
.thcc-login form, .thcc-card.form { display: grid; gap: 14px; }
#thcc-app label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
#thcc-app label small { font-weight: 400; }
#thcc-app input, #thcc-app select, #thcc-app textarea {
	font: inherit; font-size: 17px; color: var(--ink);
	padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%;
}
#thcc-app input:focus, #thcc-app select:focus, #thcc-app textarea:focus { outline: 2px solid var(--sage); border-color: transparent; }
.thcc-err { color: var(--red); margin: 0; font-size: 14px; }
.thcc-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* buttons */
.thcc-btn {
	font: inherit; font-weight: 600; font-size: 16px; border: 0; border-radius: 14px;
	padding: 14px 18px; width: 100%; cursor: pointer; transition: transform .08s, opacity .2s;
}
.thcc-btn:active { transform: scale(.98); }
.thcc-btn:disabled { opacity: .6; }
.thcc-btn.primary { background: var(--navy); color: #fff; }
.thcc-btn.danger { background: var(--caramel); color: #fff; }
.thcc-btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); margin-top: 10px; }
.thcc-btn.big { padding: 20px; font-size: 19px; margin-top: 12px; }
.thcc-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* layout */
.thcc-wrap { padding-bottom: 40px; }
.thcc-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 20px 14px; background: var(--navy); color: #fff; }
.thcc-head .hi { font-size: 13px; opacity: .7; }
.thcc-head .name { font-size: 20px; font-weight: 700; }
.thcc-head .pos { font-size: 12px; color: #D9B48A; }
.thcc-head .thcc-link { color: rgba(255,255,255,.7); }
.thcc-tabs { display: flex; background: var(--navy); padding: 0 12px; gap: 4px; position: sticky; top: 0; z-index: 2; }
.thcc-tabs button { flex: 1; background: none; border: 0; color: rgba(255,255,255,.6); font: inherit; font-size: 14px; font-weight: 600; padding: 12px 4px; border-bottom: 3px solid transparent; cursor: pointer; }
.thcc-tabs button.on { color: #fff; border-bottom-color: var(--caramel); }
.thcc-wrap main { padding: 18px 16px; }
.thcc-sub { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 18px 4px 10px; }

.thcc-clock { text-align: center; padding: 10px 0 18px; }
.thcc-clock .date { color: var(--muted); font-size: 14px; }
.thcc-clock .time { font-family: Montserrat, sans-serif; font-size: 56px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }

.thcc-card { background: var(--card); border-radius: 16px; padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); }
.thcc-card.empty { text-align: center; color: var(--muted); }
.thcc-card.empty b { color: var(--ink); }
.thcc-card.status .badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: #E5EBE1; color: #4D5946; }
.thcc-card.status.break .badge { background: #F5E7D6; color: #8A5A27; }
.thcc-card.status .big { font-size: 19px; font-weight: 700; margin: 10px 0 4px; }
.thcc-card.status .meta { color: var(--muted); font-size: 14px; }
.thcc-card .row { display: flex; justify-content: space-between; align-items: center; }
.thcc-card .row.total b { font-size: 20px; color: var(--navy); }

.thcc-shift { background: #fff; border-radius: 16px; padding: 16px 16px 16px 20px; margin-bottom: 12px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.thcc-shift::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c, var(--sage)); }
.thcc-shift .sname { font-weight: 700; font-size: 17px; }
.thcc-shift .stime { font-size: 15px; }
.thcc-shift .shours { font-size: 13px; color: var(--muted); }

.thcc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 12px; }
.thcc-stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; text-align: center; }
.thcc-stats b { display: block; font-size: 18px; }
.thcc-stats span { font-size: 11px; color: var(--muted); }

.thcc-month { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.thcc-month button { background: #fff; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 38px; font-size: 20px; cursor: pointer; color: var(--navy); }

.thcc-list .item { display: flex; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.thcc-list .item small { display: block; color: var(--muted); font-size: 12px; }
.thcc-list .item small.warn { color: var(--caramel); }
.thcc-list .item .r { text-align: right; white-space: nowrap; }
.thcc-list .st-absent, .thcc-list .st-missing_checkout { border-left: 4px solid var(--red); }
.thcc-list .st-absent .r small, .thcc-list .st-missing_checkout .r small, .thcc-list .lv-rejected .r small { color: var(--red); }
.thcc-list .st-leave_paid, .thcc-list .st-leave_unpaid { border-left: 4px solid var(--caramel); }
.thcc-list .lv-approved .r small { color: #4D5946; }

.thcc-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font: 500 15px/1.4 "Be Vietnam Pro", sans-serif; max-width: 90vw; z-index: 99999; transition: all .25s; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.thcc-toast.show { transform: translate(-50%, 0); opacity: 1; }
.thcc-toast.bad { background: var(--red); }

.thcc-pw { position: relative; display: block; }
.thcc-pw input { padding-right: 64px !important; }
.thcc-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: 600 13px "Be Vietnam Pro", sans-serif; padding: 6px 8px; cursor: pointer; }
.thcc-note { text-align: center; color: var(--muted); margin: -8px 0 18px; font-size: 14px; }
.thcc-rules { list-style: none; padding: 0; margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.thcc-rules li::before { content: "○ "; }
.thcc-rules li.ok { color: #4D5946; }
.thcc-rules li.ok::before { content: "✓ "; }
.thcc-match { margin: -6px 0 0; font-size: 13px; min-height: 1em; }
.thcc-match.ok { color: #4D5946; }
.thcc-match.bad { color: var(--red); }
.thcc-head-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.thcc-shift .shol { font-size: 13px; color: var(--caramel); font-weight: 600; margin-top: 4px; }
.spos { display: inline-block; margin-top: 6px; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 15%, #fff); color: color-mix(in srgb, var(--pc) 70%, #000); }
.spos b { font-weight: 700; }
.thcc-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.thcc-picks { display: grid; gap: 8px; }
.thcc-pick { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 12px !important; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 400 !important; color: var(--ink) !important; font-size: 15px !important; }
.thcc-pick input { width: 22px !important; height: 22px; flex: none; }
.thcc-pick small { display: block; color: var(--muted); font-size: 13px; }
.thcc-pick:has(input:checked) { border-color: var(--navy); background: #f6f5f1; }
.thcc-list .item .r .thcc-link { display: block; margin-top: 4px; font-size: 12px; }

/* Lịch ca theo tuần / tháng */
.thcc-seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 4px 0 12px; }
.thcc-seg button { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 9px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.thcc-seg button.on { background: var(--navy); color: #fff; font-weight: 600; }
.thcc-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.thcc-nav b { font-size: 15px; }
.thcc-nav button { border: 1px solid var(--line); background: #fff; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; color: var(--ink); cursor: pointer; }
.thcc-nav button:disabled { opacity: .3; cursor: default; }
.sd { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 8px; }
.sd .db { width: 60px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--beige); padding: 6px 0; }
.sd .db .w { font-size: 12px; color: var(--muted); }
.sd .db .n { font-size: 24px; font-weight: 700; line-height: 1.15; }
.sd .db .m { font-size: 11px; color: var(--muted); }
.sd.today { border-color: var(--caramel); }
.sd.today .db { background: var(--caramel); }
.sd.today .db span { color: #fff; }
.sd .sh { flex: 1; min-width: 0; display: grid; gap: 8px; align-content: center; }
.sd .sl { border-left: 3px solid var(--sage); padding: 2px 0 2px 10px; }
.sd .sl b { display: block; font-size: 15px; }
.sd .sl small { display: block; font-size: 13px; color: var(--muted); }
.sd .tg { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; margin: 4px 4px 0 0; }
.sd .tg.hol { background: #F6EBDD; color: #8A5A28; }
.sd .tg.lv { background: #E8ECE4; color: #4F5947; }
.sd .tg.pd { background: #EEF0F2; color: var(--muted); }
.sd.empty { background: transparent; border: 1px dashed #CFC9BD; padding: 6px 10px; align-items: center; }
.sd.empty .db { background: transparent; padding: 2px 0; }
.sd.empty .db .n { font-size: 18px; color: var(--muted); font-weight: 600; }
.sd.empty.today .db { background: var(--caramel); }
.sd .off { font-size: 13px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; }
.sd.past { opacity: .5; }
.thcc-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.thcc-cal .hd { font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.thcc-cal .c { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 48px; padding: 5px 1px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; color: var(--ink); cursor: pointer; }
.thcc-cal .c .k { font-size: 14px; font-weight: 600; }
.thcc-cal .c .t { font-size: 10px; line-height: 1.2; color: #8A5A28; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thcc-cal .c.lv .t { color: #4F5947; }
.thcc-cal .c.x { background: transparent; border-style: dashed; border-color: #D8D2C6; }
.thcc-cal .c.x .k { color: #A7A39B; font-weight: 400; }
.thcc-cal .c.today { background: var(--caramel); border-color: var(--caramel); }
.thcc-cal .c.today .k, .thcc-cal .c.today .t { color: #fff; }
.thcc-cal .c.past { opacity: .45; }
.thcc-cal .c.sel { outline: 2px solid var(--navy); outline-offset: 1px; }
.thcc-cal .hdot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.thcc-calsum { font-size: 13px; color: var(--muted); margin: 10px 2px; }
.sd.empty.today .db .n, .sd.empty.today .db span { color: #fff; }
.thcc-calsum .hdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin: 0 4px 1px 10px; vertical-align: middle; }
.thcc-offsite { background: #F6EBDD; color: #8A5A28; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 12px; }

/* Quản lý */
.thcc-dot { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; padding: 0 4px; vertical-align: 1px; }
.thcc-tabs button { font-size: 13px; padding: 12px 2px; }
.thcc-btn.full { width: 100%; margin-bottom: 12px; }
.thcc-btn.sm { padding: 8px 14px; font-size: 14px; }
.thcc-btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.thcc-chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; }
.thcc-chips button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.thcc-chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.thcc-card.mg { padding: 14px; }
.mg-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.mg-h b { font-size: 16px; } .mg-h span { color: var(--muted); font-size: 14px; }
.mg-h em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.mg-h em.warn, .st.warn { background: #F6EBDD; color: #8A5A28; }
.mg-h em.ok, .st.ok { background: #E8ECE4; color: #4F5947; }
.mg-p { margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.mg-p b.ok { color: #4F5947; } .mg-p b.warn { color: var(--red); }
.mg-r { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.mg-r .l { min-width: 0; } .mg-r .l small { display: block; color: var(--muted); font-size: 13px; }
.mg-r .l small.pos { display: inline; font-size: 12px; background: #EEF0F2; padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.mg-r .l small.warn { color: #8A5A28; }
.mg-r .r { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.st { font-size: 12px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.st.bad { background: #F7E4E1; color: var(--red); } .st.mute { background: #EEF0F2; color: var(--muted); }
small.mute { color: var(--muted); font-size: 12px; }
.thcc-link.danger { color: var(--red); }
.mg-edit { background: #F6F5F1; border-radius: 12px; padding: 12px; margin: 0 0 8px; display: grid; gap: 10px; }
.mg-edit label, .mg-add label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.mg-edit input { font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mg-add { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mg-add select { flex: 1 1 140px; min-width: 0; font: inherit; font-size: 15px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.thcc-search { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.thcc-call { color: var(--navy); font-weight: 600; text-decoration: none; border: 1px solid var(--line); padding: 6px 10px; border-radius: 10px; background: #fff; }
