:root {
  --red: #c1272d;
  --red-dark: #9e1f24;
  --gray: #58595b;
  --gray-light: #8a8b8d;
  --bg: #f7f5f4;
  --card-bg: #ffffff;
  --border: #e7e2e1;
  --text: #2b2b2b;
  --muted: #8a8b8d;
  --working: #2e9e5b;
  --break: #d99a2b;
  --lunch: #3b6fa0;
  --out: #9aa0a6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--red); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img { height: 49px; display: block; }

.brand .divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 6px;
}

.brand .page-title {
  font-weight: 700;
  color: var(--gray);
  font-size: 15px;
  letter-spacing: 0.3px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-right .user-name { color: var(--gray); font-size: 14px; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--gray); color: #fff; }
.btn-secondary:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--gray); border: 1px solid var(--border); }
.btn-outline:hover { background: #f2f0ef; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card img.logo { height: 60px; margin-bottom: 8px; }
.login-card h1 { font-size: 18px; color: var(--gray); margin: 6px 0 22px; font-weight: 700; }

.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--gray); margin-bottom: 6px; font-weight: 600; }
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fcfbfb;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red); background: #fff; }

.error-text { color: var(--red); font-size: 13px; margin: 10px 0 0; min-height: 16px; }
.hint-text { color: var(--muted); font-size: 12px; margin-top: 14px; }

.status-hero {
  text-align: center;
  padding: 30px 20px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }

.status-not_started { background: #eef0f1; color: var(--out); }
.status-not_started .dot { background: var(--out); }
.status-working { background: #e7f6ee; color: var(--working); }
.status-working .dot { background: var(--working); }
.status-on_break { background: #fbf1de; color: var(--break); }
.status-on_break .dot { background: var(--break); }
.status-on_lunch { background: #e9f0f8; color: var(--lunch); }
.status-on_lunch .dot { background: var(--lunch); }
.status-checked_out { background: #f0eeee; color: var(--gray); }
.status-checked_out .dot { background: var(--gray); }

.hero-name { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 10px; }

.hero-clock {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-clock .hero-clock-time { font-size: 16px; font-weight: 700; color: var(--gray); }
.hero-clock-date::before { content: "·"; margin-right: 8px; }

.sub-clock { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.action-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.action-row .btn { min-width: 160px; padding: 14px 20px; font-size: 15px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 22px; }
.stat-box { background: #fbf9f9; border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-box .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.stat-box .value { font-size: 20px; font-weight: 700; color: var(--gray); }

h2.section-title { font-size: 15px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.4px; margin: 34px 0 12px; }

table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
table th, table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
table tr:last-child td { border-bottom: none; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.timeline li:last-child { border-bottom: none; }
.timeline .event-type { font-weight: 600; color: var(--text); }
.timeline .event-time { color: var(--muted); }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.filters .field { margin-bottom: 0; min-width: 160px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(30, 26, 25, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-card { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.modal-card h3 { margin-top: 0; color: var(--gray); }
.hidden { display: none !important; }

.empty-state { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }

.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-nav .btn { padding: 6px 12px; font-size: 14px; }
.calendar-month-label { font-weight: 700; color: var(--gray); min-width: 140px; text-align: center; }

.calendar-header-row, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-header-row { margin-bottom: 8px; }
.calendar-header-row div { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }

.cal-day {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  min-height: 58px;
  background: #fff;
  cursor: pointer;
  transition: filter 0.1s ease;
}
.cal-day:hover { filter: brightness(0.97); }
.cal-day .num { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-day .sub { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.cal-day.empty { visibility: hidden; cursor: default; }
.cal-day.weekend { background: #faf9f8; }
.cal-day.has-activity { background: #eaf6f0; border-color: #cdebd9; }
.cal-day.on-leave { background: #eaf1fb; border-color: #cfe0f5; }
.cal-day.is-today { box-shadow: 0 0 0 2px var(--red) inset; }
.cal-day.is-future { opacity: 0.4; cursor: default; pointer-events: none; }
.cal-day.selected { border-color: var(--gray); box-shadow: 0 0 0 2px var(--gray) inset; }

.calendar-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
