:root {
  --blue: #558CB3;
  --blue-dark: #356b91;
  --blue-soft: #eaf3f8;
  --ink: #14222d;
  --muted: #667784;
  --line: #dce6ec;
  --surface: #ffffff;
  --canvas: #f3f7f9;
  --green: #2f8f69;
  --green-soft: #e8f6f0;
  --amber: #a76c18;
  --amber-soft: #fff4df;
  --red: #bd514d;
  --red-soft: #fceceb;
  --shadow: 0 18px 45px rgba(30, 62, 82, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, .85fr) minmax(500px, 1.15fr);
}
.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: white;
  background: linear-gradient(145deg, #356b91, #6da4c8);
}
.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
}
.login-brand::before { width: 480px; height: 480px; right: -210px; top: -150px; }
.login-brand::after { width: 330px; height: 330px; left: -130px; bottom: -130px; }
.brand-copy { position: relative; z-index: 1; display: grid; place-items: center; }
.brand-copy img { width: min(340px, 75%); height: auto; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0,0,0,.17)); }
.brand-copy h1 {
  margin: 24px 0 12px;
  max-width: 430px;
  font: 800 43px/1.08 "Manrope", sans-serif;
  letter-spacing: -.04em;
}
.brand-copy p { max-width: 420px; margin: 0; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.65; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 54px; background: white; }
.login-card { width: 100%; max-width: 440px; }
.eyebrow { margin: 0 0 10px; color: var(--blue-dark); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
h2 { margin: 0; font: 800 30px/1.2 "Manrope", sans-serif; letter-spacing: -.03em; }
.login-card > p { color: var(--muted); margin: 12px 0 32px; line-height: 1.55; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: 13px; color: #354653; }
.field input, .field select, .field textarea, .control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
  transition: .2s;
}
.field textarea { min-height: 90px; resize: vertical; }
.quick-create {
  grid-column: 1 / -1;
  margin: -5px 0 18px;
  padding: 16px;
  border: 1px dashed #b9cedb;
  border-radius: 12px;
  background: #f7fbfd;
}
.quick-create.hidden { display: none; }
.quick-create-title { margin: 0 0 14px; font: 800 14px "Manrope", sans-serif; }
.quick-event-toggle { justify-self: start; margin-top: -8px; margin-bottom: 17px; }
.inline-create-toggle { margin-top: 7px; padding: 4px 0; }
.inline-create { margin-top: 10px; }
.inline-create.hidden { display: none; }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(85,140,179,.12);
}
.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--blue-soft);
  transition: transform .15s, background .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.btn-primary { color: white; background: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-dark { color: white; background: var(--ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-block { width: 100%; padding: 14px 18px; }
.demo-box {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid #cfe0ea;
  border-radius: 13px;
  background: var(--blue-soft);
  color: #466273;
  font-size: 13px;
  line-height: 1.6;
}
.demo-switch { display: flex; gap: 8px; margin-top: 10px; }
.demo-switch button { flex: 1; padding: 8px; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 255px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background: #183040;
  color: white;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.sidebar-brand img { width: 48px; height: 48px; object-fit: contain; }
.sidebar-brand strong { display: block; font: 800 16px "Manrope"; }
.sidebar-brand span { display: block; color: #8ba9bb; font-size: 11px; margin-top: 3px; }
.nav { display: grid; gap: 5px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  color: #b8cbd6;
  background: transparent;
  text-align: left;
  font-weight: 600;
}
.nav button:hover { color: white; background: rgba(255,255,255,.07); }
.nav button.active { color: white; background: var(--blue); }
.nav svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.user-mini { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-weight: 800;
  font-size: 13px;
}
.user-mini strong { display: block; font-size: 13px; }
.user-mini span { color: #8ba9bb; font-size: 11px; }
.logout { margin-top: 13px; color: #b8cbd6; background: transparent; border: 0; padding: 0; font-size: 12px; }
.demo-data-btn { width: 100%; margin-bottom: 14px; border-color: rgba(255,255,255,.16); color: #b8cbd6; background: rgba(255,255,255,.04); }
.warning-box { padding: 14px; border: 1px solid #f1c9c6; border-radius: 11px; color: #8f403d; background: var(--red-soft); font-size: 12px; line-height: 1.55; }

.workspace { min-width: 0; }
.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font: 800 22px "Manrope"; letter-spacing: -.025em; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.date-pill { padding: 9px 12px; border-radius: 10px; color: #49606f; background: var(--blue-soft); font-size: 12px; font-weight: 600; }
.main { padding: 30px 36px 50px; max-width: 1500px; margin: auto; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head h2 { font-size: 24px; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr); align-items: start; }
.employee-dashboard { display: flex; flex-direction: column; }
.employee-stats { order: 1; }
.employee-clock-section { order: 2; }
.employee-recent { order: 3; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(31,67,91,.04);
}
.click-card {
  cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.click-card:hover {
  transform: translateY(-2px);
  border-color: #b7cedc;
  box-shadow: 0 14px 34px rgba(31,67,91,.09);
}
.click-card:focus-visible {
  outline: 3px solid rgba(85,140,179,.25);
  outline-offset: 3px;
}
.card-pad { padding: 22px; }
.stat { position: relative; overflow: hidden; padding: 19px 20px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .value { margin-top: 8px; font: 800 27px "Manrope"; letter-spacing: -.035em; }
.stat .hint { margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-icon {
  position: absolute; right: 16px; top: 16px;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  color: var(--blue-dark); background: var(--blue-soft);
}
.stat-icon svg { width: 19px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.card-title h3 { margin: 0; font: 800 16px "Manrope"; }
.card-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.link-btn { border: 0; background: transparent; color: var(--blue-dark); font-weight: 700; font-size: 12px; }

.clock-card {
  position: relative;
  overflow: hidden;
  min-height: 315px;
  padding: 30px;
  color: white;
  background: linear-gradient(135deg, #356b91, #68a1c5);
}
.clock-card::after {
  content: ""; position: absolute; width: 300px; height: 300px; right: -140px; bottom: -180px;
  border: 50px solid rgba(255,255,255,.06); border-radius: 50%;
}
.clock-label { color: rgba(255,255,255,.7); font-size: 12px; font-weight: 600; }
.live-time { margin: 6px 0 18px; font: 800 52px "Manrope"; letter-spacing: -.06em; }
.active-event { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,.14); font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #9cf0cb; box-shadow: 0 0 0 5px rgba(156,240,203,.14); }
.clock-actions { position: relative; z-index: 1; display: flex; gap: 10px; margin-top: 28px; }
.clock-actions .btn { background: white; color: var(--blue-dark); }
.clock-actions .btn.secondary { color: white; background: rgba(255,255,255,.14); }
.event-select {
  width: min(100%, 420px); margin-top: 18px; padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
  color: white; background: rgba(18,47,66,.18); outline: none;
}
.event-select option { color: var(--ink); background: white; }

.list { display: grid; }
.list-row { display: grid; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #eaf0f3; }
.list-row:last-child { border-bottom: 0; }
.event-row { grid-template-columns: 44px 1fr auto; }
.date-box { display: grid; place-items: center; width: 42px; height: 44px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; font-size: 16px; }
.date-box small { display: block; margin-top: -4px; font-size: 9px; text-transform: uppercase; }
.row-title { font-weight: 700; font-size: 13px; }
.row-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-green { color: var(--green); background: var(--green-soft); }
.badge-amber { color: var(--amber); background: var(--amber-soft); }
.badge-blue { color: var(--blue-dark); background: var(--blue-soft); }
.badge-red { color: var(--red); background: var(--red-soft); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: var(--muted); background: #f7fafb; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 14px; border-bottom: 1px solid #eaf0f3; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 34px; height: 34px; }
.person strong { display: block; font-size: 12px; }
.person span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.person-link {
  border: 0;
  padding: 6px 10px 6px 4px;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background .16s, transform .16s;
}
.person-link:hover { background: var(--blue-soft); transform: translateX(2px); }
.person-link:hover strong { color: var(--blue-dark); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.profile-person { display: flex; align-items: center; gap: 14px; }
.profile-person .avatar { width: 56px; height: 56px; font-size: 17px; }
.profile-person h2 { font-size: 24px; }
.profile-person p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.detail-grid { grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); align-items: start; }
.cost-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #eaf0f3;
}
.cost-line:last-child { border-bottom: 0; }
.cost-line strong { font-size: 13px; }
.cost-line span { color: var(--muted); font-size: 11px; }
.cost-line .money { color: var(--ink); font-size: 13px; }
.money { font-weight: 800; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.toolbar .control { width: auto; min-width: 170px; padding: 9px 12px; font-size: 12px; }
.search-control { position: relative; width: min(360px, 100%); }
.search-control svg {
  position: absolute;
  left: 13px; top: 50%;
  width: 17px; height: 17px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-control input { padding-left: 40px; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.event-no-results { grid-column: 1 / -1; }
.assignment-button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 165px; padding: 9px 10px;
  border: 1px dashed #b8cbd7; border-radius: 9px;
  color: var(--blue-dark); background: #f7fbfd;
  font-size: 11px; font-weight: 700; text-align: left;
}
.assignment-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.assignment-change { display: block; margin-top: 5px; padding: 0; }
.assignment-list { display: grid; gap: 7px; max-height: 310px; overflow-y: auto; margin-top: 14px; }
.assignment-option {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); background: white; text-align: left;
}
.assignment-option:hover { border-color: var(--blue); background: var(--blue-soft); }
.assignment-option strong { display: block; font-size: 12px; }
.assignment-option span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.assignment-create-toggle { width: 100%; margin-top: 10px; }
.assignment-create-panel { margin-top: 10px; padding: 15px; border: 1px dashed #b8cbd7; border-radius: 12px; background: #f7fbfd; }
.assignment-create-panel.hidden { display: none; }
#assignment-new-client-field.hidden { display: none; }
.empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 5px; }

.bar-chart { display: flex; align-items: flex-end; gap: 18px; height: 210px; padding: 15px 4px 0; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar { width: min(42px, 80%); min-height: 8px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #6aa2c6, #558CB3); transition: height .4s; }
.bar-col span { color: var(--muted); font-size: 10px; }
.bar-col b { color: #476170; font-size: 9px; }
.progress-row { margin-bottom: 17px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 7px; }
.progress-track { height: 7px; border-radius: 99px; overflow: hidden; background: #eaf0f3; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.report-person {
  border: 0;
  padding: 3px 6px;
  margin: -3px -6px;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  text-align: left;
}
.report-person:hover { color: var(--blue-dark); background: var(--blue-soft); }
.month-picker {
  min-width: 170px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
  font-weight: 700;
  outline: none;
}
.month-picker:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(85,140,179,.12); }
.date-control { position: relative; width: 100%; }
.date-control input { padding-right: 44px !important; cursor: pointer; }
.date-control input::-webkit-calendar-picker-indicator { display: none; }
.calendar-trigger {
  position: absolute;
  top: 50%; right: 7px;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--blue-soft);
}
.calendar-trigger svg { width: 17px; height: 17px; }
.calendar-layer { position: fixed; inset: 0; z-index: 90; }
.calendar-popover {
  position: fixed;
  width: 310px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 65px rgba(21,48,65,.22);
}
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.calendar-head strong { font: 800 14px "Manrope", sans-serif; }
.calendar-nav { display: flex; gap: 5px; }
.calendar-nav button {
  display: grid; place-items: center;
  width: 31px; height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink); background: white;
}
.calendar-nav button:hover { color: var(--blue-dark); background: var(--blue-soft); }
.calendar-week, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-week span { padding: 5px 0; color: var(--muted); text-align: center; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.calendar-day, .calendar-month {
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}
.calendar-day { aspect-ratio: 1; }
.calendar-day:hover, .calendar-month:hover { color: var(--blue-dark); background: var(--blue-soft); }
.calendar-day.muted { color: #bdc8cf; }
.calendar-day.today { outline: 1px solid var(--blue); }
.calendar-day.selected, .calendar-month.selected { color: white; background: var(--blue); }
.calendar-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.calendar-month { padding: 11px 5px; }
.time-popover { width: 280px; }
.time-display {
  margin: 2px 0 14px;
  color: var(--blue-dark);
  font: 800 28px "Manrope", sans-serif;
  text-align: center;
  letter-spacing: -.04em;
}
.time-wheels { position: relative; display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 5px; }
.time-wheel {
  height: 174px;
  overflow-y: auto;
  padding: 61px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(white, #f7fafb 42%, #f7fafb 58%, white);
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
}
.time-wheel::-webkit-scrollbar { display: none; }
.time-wheel button {
  display: block;
  width: 100%; height: 42px;
  border: 0;
  border-radius: 8px;
  color: #82909a;
  background: transparent;
  font-weight: 700;
  scroll-snap-align: center;
}
.time-wheel button:hover { color: var(--blue-dark); background: var(--blue-soft); }
.time-wheel button.selected { color: white; background: var(--blue); font-size: 15px; }
.time-colon { color: var(--ink); font: 800 22px "Manrope"; text-align: center; }
.time-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(14,31,42,.55);
  backdrop-filter: blur(5px);
}
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; padding: 23px 25px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font: 800 18px "Manrope"; }
.modal-close { border: 0; background: transparent; font-size: 24px; color: var(--muted); }
.modal-body { padding: 24px 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 6px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; transform: translateY(90px); opacity: 0; padding: 13px 18px; border-radius: 11px; color: white; background: #183040; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; transition: .3s; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-menu { display: none; }

@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -275px; z-index: 40; width: 255px; transition: left .25s; }
  .sidebar.open { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,.2); }
  .topbar { height: 70px; padding: 0 18px; }
  .mobile-menu { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: white; }
  .top-title { display: flex; align-items: center; gap: 12px; }
  .date-pill { display: none; }
  .main { padding: 22px 16px 40px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .profile-head { align-items: flex-start; flex-direction: column; }
  .employee-clock-section { order: 0; margin-top: 0 !important; margin-bottom: 18px; }
  .employee-stats { order: 1; }
  .employee-recent { order: 2; }
}
@media (max-width: 540px) {
  .grid-4 { grid-template-columns: 1fr; }
  .login-panel { padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .live-time { font-size: 42px; }
  .clock-card { padding: 23px; }
  .clock-actions { flex-direction: column; }
  .topbar h1 { font-size: 18px; }
  .month-picker { width: 100%; }
  .calendar-popover { width: calc(100vw - 24px); left: 12px !important; }
  .time-popover { width: min(300px, calc(100vw - 24px)); left: 12px !important; }
  .quick-create { grid-column: auto; }
  .table-tools, .search-control { width: 100%; }
}
