:root{
  --bg: #1B1F27;
  --panel: #242A35;
  --panel-raised: #2C3340;
  --line: #3A4152;
  --amber: #E8A23D;
  --amber-dim: #7A5A26;
  --green: #4CAF7D;
  --red: #E0654F;
  --text: #F2EFE8;
  --text-dim: #9AA0AC;
  --text-faint: #6B7180;
  --radius: 10px;
}
*{box-sizing:border-box;}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:'Space Grotesk', sans-serif; min-height:100vh; -webkit-font-smoothing:antialiased;
}
.wrap{ max-width:760px; margin:0 auto; padding:28px 20px 60px; }

header.top{
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-bottom:22px; padding-bottom:18px; border-bottom:1px solid var(--line); gap:12px; flex-wrap:wrap;
}
header.top h1{ font-size:22px; font-weight:600; margin:0; letter-spacing:-0.01em; }
.top-right{ display:flex; align-items:center; gap:16px; }
.live-clock{ font-family:'IBM Plex Mono', monospace; font-size:15px; color:var(--text-dim); text-align:right; }
.live-clock .date{ font-size:12px; color:var(--text-faint); margin-top:2px; }
.session-box{ text-align:right; }
.session-box .who{ font-size:13px; color:var(--text); font-weight:500; }
.session-box .role{ font-size:11px; color:var(--text-faint); }
button.logout{
  background:transparent; border:1px solid var(--line); color:var(--text-dim);
  font-family:inherit; font-size:12px; padding:5px 10px; border-radius:6px; cursor:pointer; margin-top:4px;
}
button.logout:hover{ color:var(--text); border-color:var(--text-faint); }

nav.tabs{ display:flex; gap:4px; margin-bottom:22px; background:var(--panel); border-radius:var(--radius); padding:4px; flex-wrap:wrap; }
nav.tabs button{
  flex:1; min-width:100px; background:transparent; border:none; color:var(--text-dim);
  font-family:inherit; font-size:14px; font-weight:500; padding:10px 12px; border-radius:7px; cursor:pointer;
  transition:background .15s ease, color .15s ease;
}
nav.tabs button.active{ background:var(--panel-raised); color:var(--text); }
nav.tabs button:hover:not(.active){ color:var(--text); }

.panel{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:24px; margin-bottom:16px; }

select, input[type=text], input[type=password], input[type=date], input[type=time]{
  width:100%; background:var(--panel-raised); border:1px solid var(--line); color:var(--text);
  font-family:inherit; font-size:15px; padding:11px 12px; border-radius:8px; outline:none;
}
select:focus, input:focus{ border-color:var(--amber-dim); }
label.field-label{ display:block; font-size:13px; color:var(--text-dim); margin-bottom:6px; }
.field{ margin-bottom:14px; }

.punch-stage{ text-align:center; padding:18px 0 6px; }
.punch-stage .who{ font-size:14px; color:var(--text-dim); margin-bottom:4px; }
.punch-stage .status-line{ font-family:'IBM Plex Mono', monospace; font-size:14px; color:var(--text-faint); margin-bottom:22px; min-height:18px; }
.punch-stage .status-line.in{ color: var(--green); }
.punch-stage .status-line .elapsed{ color:var(--text); font-weight:500; }

button.punch-btn{
  font-family:'Space Grotesk', sans-serif; font-size:17px; font-weight:600; border:none; border-radius:999px;
  padding:20px 40px; cursor:pointer; color:#14170F; background:var(--green);
  transition:transform .1s ease, opacity .15s ease; min-width:240px;
}
button.punch-btn.out-state{ background:var(--red); color:#1A0E0B; }
button.punch-btn:disabled{ opacity:.4; cursor:not-allowed; }
button.punch-btn:active:not(:disabled){ transform:scale(0.97); }

.empty-hint{ text-align:center; color:var(--text-faint); font-size:14px; padding:20px 0; }

button.btn-amber{
  background:var(--amber); color:#241703; border:none; font-family:inherit; font-weight:600;
  font-size:14px; padding:11px 18px; border-radius:8px; cursor:pointer; white-space:nowrap;
}
button.btn-amber:disabled{ opacity:.4; cursor:not-allowed; }
button.btn-ghost{
  background:transparent; border:1px solid var(--line); color:var(--text-dim); font-family:inherit;
  font-size:13px; padding:9px 14px; border-radius:8px; cursor:pointer;
}
button.btn-ghost:hover{ color:var(--text); border-color:var(--text-faint); }
button.link-btn{
  background:transparent; border:none; color:var(--text-faint); font-family:inherit; font-size:13px;
  cursor:pointer; text-decoration:underline; padding:0;
}
button.link-btn:hover{ color:var(--text); }

.add-row{ display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.add-row input{ flex:1; min-width:140px; }

ul.emp-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:1px; background:var(--line); border-radius:8px; overflow:hidden; }
ul.emp-list li{ background:var(--panel); display:flex; align-items:center; justify-content:space-between; padding:13px 14px; font-size:14px; gap:10px; flex-wrap:wrap; }
ul.emp-list li .who{ display:flex; align-items:center; }
ul.emp-list li .dot{ display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:10px; flex-shrink:0; }
ul.emp-list li .dot.on{ background:var(--green); }
ul.emp-list li .dot.off{ background:var(--text-faint); }
ul.emp-list li .pin-tag{ font-family:'IBM Plex Mono', monospace; font-size:11px; color:var(--text-faint); margin-left:8px; }
ul.emp-list li .username-tag{ font-family:'IBM Plex Mono', monospace; font-size:11px; color:var(--text-faint); margin-left:8px; }
ul.emp-list li .actions{ display:flex; gap:12px; flex-shrink:0; }
ul.emp-list li button.remove, ul.emp-list li button.reset, ul.emp-list li button.editsched{
  background:transparent; border:none; color:var(--text-faint); font-size:12px; cursor:pointer; font-family:inherit;
}
ul.emp-list li button.remove:hover{ color:var(--red); }
ul.emp-list li button.reset:hover, ul.emp-list li button.editsched:hover{ color:var(--amber); }

.summary-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-bottom:20px; }
.summary-card{ background:var(--panel-raised); border:1px solid var(--line); border-radius:8px; padding:14px; }
.summary-card .name{ font-size:13px; color:var(--text-dim); margin-bottom:6px; }
.summary-card .hours{ font-family:'IBM Plex Mono', monospace; font-size:20px; font-weight:500; }
.summary-card .period{ font-size:11px; color:var(--text-faint); margin-top:2px; }

table.log{ width:100%; border-collapse:collapse; font-size:13px; }
table.log th{ text-align:left; font-weight:500; color:var(--text-faint); padding:8px 10px; border-bottom:1px solid var(--line); font-size:12px; }
table.log td{ padding:9px 10px; border-bottom:1px solid var(--line); font-family:'IBM Plex Mono', monospace; color:var(--text-dim); vertical-align:middle; }
table.log td.name-cell{ font-family:'Space Grotesk', sans-serif; color:var(--text); }
table.log tr:last-child td{ border-bottom:none; }
.open-tag{ color:var(--green); font-size:11px; font-family:'Space Grotesk', sans-serif; margin-left:6px; }
.row-actions{ display:flex; gap:10px; }
.row-actions button{ background:transparent; border:none; color:var(--text-faint); font-family:'Space Grotesk', sans-serif; font-size:12px; cursor:pointer; }
.row-actions button:hover{ color:var(--text); }
.row-actions button.danger:hover{ color:var(--red); }

.edit-row td{ background:var(--panel-raised); padding:12px 10px; }
.edit-form{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.edit-form input{ width:auto; padding:7px 9px; font-size:13px; }
.edit-form input[type=date]{ min-width:130px; }
.edit-form input[type=time]{ min-width:90px; }
.edit-form .sep{ color:var(--text-faint); font-size:12px; }
.edit-form-actions{ display:flex; gap:8px; margin-left:auto; }
.edit-form-actions button{ font-family:inherit; font-size:12px; border:none; border-radius:6px; padding:7px 12px; cursor:pointer; }
.save-btn{ background:var(--green); color:#0F1A14; }
.cancel-btn{ background:transparent; color:var(--text-faint); border:1px solid var(--line) !important; }

.section-title{ font-size:13px; color:var(--text-dim); margin:0 0 12px; padding-top:4px; }
.section-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; gap:8px; }
.section-head .section-title{ margin:0; }

.loading{ text-align:center; color:var(--text-faint); padding:40px 0; font-size:14px; }

.login-wrap{ max-width:380px; margin:60px auto 0; }
.login-title{ text-align:center; margin-bottom:26px; }
.login-title h1{ font-size:24px; margin:0 0 6px; font-weight:600; }
.login-title p{ color:var(--text-faint); font-size:13px; margin:0; }
.choice-btns{ display:flex; flex-direction:column; gap:10px; }
button.choice-btn{
  background:var(--panel-raised); border:1px solid var(--line); color:var(--text); font-family:inherit;
  font-size:15px; font-weight:500; padding:18px; border-radius:10px; cursor:pointer; text-align:left;
}
button.choice-btn:hover{ border-color:var(--amber-dim); }
button.choice-btn .sub{ display:block; font-size:12px; color:var(--text-faint); font-weight:400; margin-top:3px; }
.error-msg{ color:var(--red); font-size:13px; margin-top:10px; min-height:16px; }
.back-link{ margin-top:16px; text-align:center; }
.or-sep{ display:flex; align-items:center; gap:10px; margin:14px 0; color:var(--text-faint); font-size:12px; }
.or-sep::before, .or-sep::after{ content:''; flex:1; height:1px; background:var(--line); }

/* schedule grid */
.sched-grid{ display:flex; flex-direction:column; gap:1px; background:var(--line); border-radius:8px; overflow:hidden; margin-bottom:16px; }
.sched-row{ background:var(--panel-raised); display:flex; align-items:center; gap:10px; padding:10px 12px; flex-wrap:wrap; }
.sched-row .day-label{ width:80px; font-size:13px; color:var(--text); flex-shrink:0; }
.sched-row label.work-toggle{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-dim); flex-shrink:0; }
.sched-row input[type=checkbox]{ width:16px; height:16px; accent-color: var(--green); }
.sched-row input[type=time]{ width:auto; min-width:90px; padding:7px 9px; font-size:13px; }
.sched-row .sep{ color:var(--text-faint); font-size:12px; }
.sched-row.off input[type=time]{ opacity:.35; pointer-events:none; }
.sched-mini{ display:flex; flex-direction:column; gap:4px; font-size:13px; }
.sched-mini .d{ display:flex; justify-content:space-between; color:var(--text-dim); }
.sched-mini .d .lbl{ color:var(--text); }
.sched-mini .d.off{ color:var(--text-faint); }

::selection{ background:var(--amber-dim); }
