*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f7f6f3; --surface: #ffffff; --surface2: #f2f1ee; --border: #e5e3de; --border2: #d4d2cc;
  --text: #1a1917; --text2: #6b6966; --text3: #9c9a96;
  --accent: #2d5be3; --accent-light: #eef2fd;
  --green: #1a7a4a; --green-bg: #eaf5ef;
  --amber: #a05c0a; --amber-bg: #fdf3e3;
  --red: #b02a2a; --red-bg: #fdeaea;
  --blue: #1a5fa0; --blue-bg: #e8f0fb;
  --purple: #5b3fa0; --purple-bg: #f0ecfb;
  --radius: 10px; --radius-sm: 6px;
}
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh; }
.hidden { display: none !important; }
/* LOGIN */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1a1917,#2d2c2a 50%,#1e2a4a); padding: 1.5rem; }
.login-card { background: var(--surface); border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.brand { text-align: center; margin-bottom: 2rem; }
.brand-icon { font-size: 42px; line-height: 1; margin-bottom: 8px; }
.brand h1 { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.brand p { color: var(--text2); font-size: 13px; margin-top: 4px; }
/* FORM */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border2); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; background: var(--surface); color: var(--text); outline: none; transition: border .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.hint { color: var(--text3); font-weight: 400; text-transform: none; letter-spacing: 0; }
/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: opacity .15s, background .15s; }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { opacity: .85; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border2); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--text2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-link { background: none; border: none; color: var(--accent); font-family: inherit; font-size: 13px; cursor: pointer; display: block; text-align: center; margin-top: 10px; padding: 4px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-green  { background: var(--green-bg);  color: var(--green);  border-color: #b5dfc7; }
.btn-amber  { background: var(--amber-bg);  color: var(--amber);  border-color: #f0d4a8; }
.btn-blue   { background: var(--blue-bg);   color: var(--blue);   border-color: #b8d0ef; }
.btn-red    { background: var(--red-bg);    color: var(--red);    border-color: #f0bcbc; }
.btn-purple { background: var(--purple-bg); color: var(--purple); border-color: #c9b8ef; }
.btn-green:hover  { background: #c5e8d4; } .btn-amber:hover { background: #fae0be; }
.btn-blue:hover   { background: #c5d9f5; } .btn-red:hover   { background: #f5cece; }
.btn-purple:hover { background: #ddd4f5; }
button:disabled { opacity: .35 !important; cursor: not-allowed !important; }
/* MESSAGES */
.msg-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #f0bcbc; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 10px; }
.msg-success { background: var(--green-bg); color: var(--green); border: 1px solid #b5dfc7; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 10px; }
.msg-info    { background: var(--blue-bg);  color: var(--blue);  border: 1px solid #b8d0ef; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 10px; }
/* TOPBAR */
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.topbar-brand { font-weight: 700; font-size: 16px; letter-spacing: -.3px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.admin-badge { background: var(--text); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; letter-spacing: .5px; }
.live-clock { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--text2); min-width: 60px; text-align: right; }
/* ADMIN NAV */
.admin-nav { display: flex; gap: 2px; }
.nav-tab { background: none; border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; color: var(--text2); cursor: pointer; transition: all .15s; position: relative; }
.nav-tab:hover { background: var(--surface2); color: var(--text); }
.nav-tab.active { background: var(--surface2); color: var(--text); font-weight: 600; }
.nav-tab .badge-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--surface); display: none; }
.nav-tab .badge-dot.show { display: block; }
/* EMPLOYEE PAGE */
.page-main { max-width: 740px; margin: 0 auto; padding: 1.5rem 1rem; }
.emp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 10px; }
.emp-greeting { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.emp-greeting h2 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.emp-greeting p  { font-size: 13px; color: var(--text2); }
.status-pill { font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 20px; background: var(--surface2); color: var(--text2); }
.status-pill.working  { background: var(--green-bg); color: var(--green); }
.status-pill.complete { background: var(--blue-bg);  color: var(--blue); }
/* TIME GRID */
.time-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 1rem; }
.time-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; }
.time-label { display: block; font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.time-value { font-family: 'DM Mono', monospace; font-size: 17px; font-weight: 500; }
/* PROGRESS */
.progress-wrap { margin-bottom: 1.25rem; }
.progress-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.progress-bar  { height: 7px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
/* ACTION BUTTONS */
.action-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 1rem; }
.act-btn { padding: 14px 8px; border-radius: var(--radius); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1.5px solid; transition: all .15s; }
.act-icon { font-size: 20px; line-height: 1; }
/* TABS inside employee */
.emp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.emp-tab-btn { background: none; border: none; padding: 8px 14px; font-family: inherit; font-size: 13px; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.emp-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.emp-tab-panel { display: none; } .emp-tab-panel.active { display: block; }
/* SECTION CARD */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; flex-wrap: wrap; gap: 8px; }
/* TABLE */
.wt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wt-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.wt-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.wt-table tr:last-child td { border-bottom: none; }
.wt-table tr:hover td { background: var(--surface2); }
.wt-table .actions { display: flex; gap: 5px; flex-wrap: wrap; }
.mono { font-family: 'DM Mono', monospace; }
/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray   { background: var(--surface2);  color: var(--text2); }
.late-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: 4px; vertical-align: middle; }
/* METRICS */
.metrics-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 1.25rem; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.m-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; font-weight: 600; }
.m-val   { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.m-sub   { font-size: 12px; color: var(--text3); margin-top: 4px; }
/* ADMIN */
.admin-main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
.admin-tab-panel { display: none; } .admin-tab-panel.active { display: block; }
.tab-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 10px; }
.tab-header h2 { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.tab-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tab-controls input, .tab-controls select { font-family: inherit; font-size: 13px; border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 7px 10px; background: var(--surface); color: var(--text); }
/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal { background: var(--surface); border-radius: 14px; padding: 1.75rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; }
.modal-id-preview { font-size: 13px; color: var(--text2); background: var(--surface2); padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 1rem; }
/* EMP LIST */
.emp-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.emp-list-item:last-child { border-bottom: none; }
.emp-list-info { flex: 1; min-width: 0; }
.emp-list-name { font-weight: 600; font-size: 14px; }
.emp-list-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.emp-list-actions { display: flex; gap: 5px; flex-wrap: wrap; }
/* TASK FORM */
.task-form { padding: 1rem; }
/* CORRECTION LIST */
.correction-item { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.correction-item:last-child { border-bottom: none; }
.correction-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.correction-meta { font-size: 12px; color: var(--text2); margin-top: 3px; }
.correction-times { display: flex; gap: 12px; font-size: 13px; flex-wrap: wrap; }
.correction-reason { font-size: 12px; color: var(--text2); margin-top: 4px; font-style: italic; }
/* SETTINGS */
.settings-form { max-width: 480px; }
/* RESPONSIVE */
@media (max-width: 600px) {
  .time-grid { grid-template-columns: repeat(2,1fr); }
  .action-grid { grid-template-columns: repeat(2,1fr); }
  .metrics-row { grid-template-columns: repeat(2,1fr); }
  .admin-nav { flex-wrap: wrap; gap: 2px; }
}

/* ── LOGO ───────────────────────────────────────────────── */
.login-logo {
  height: 52px;
  width: auto;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  /* Logo has black bg - invert not needed, show on dark card */
}
.topbar-logo {
  height: 30px;
  width: auto;
  display: block;
  /* Logo has black background - add a subtle pill background */
  /* background: #111; */
  border-radius: 6px;
  padding: 3px 8px;
}

/* ── PROFILE PICTURE ─────────────────────────────────────── */
.avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}
.profile-pic-wrap {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.profile-pic-preview {
  flex-shrink: 0;
}
.profile-pic-preview img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.profile-pic-info {
  flex: 1;
  min-width: 200px;
  padding-top: 4px;
}

/* ── EMPLOYEE TOPBAR AVATAR ──────────────────────────────── */
#emp-avatar {
  cursor: pointer;
  transition: opacity .15s;
  position: relative;
  overflow: hidden;
}
#emp-avatar:hover { opacity: .85; }
#emp-avatar img.avatar-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
