:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #64717f;
  --line: #d8e0e8;
  --surface: #ffffff;
  --page: #f4f7f9;
  --navy: #15324a;
  --teal: #0f8f8a;
  --green: #2f8f4e;
  --red: #c34040;
  --amber: #f2a93b;
  --shadow: 0 18px 42px rgba(21, 50, 74, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 143, 138, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(242, 169, 59, 0.12), transparent 36%),
    var(--page);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 0.95fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.brand,
.identity-panel,
.login-card,
.status-band,
.leave-form,
.records-section,
.late-alert {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 224, 232, 0.9);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 104px;
  padding: 18px 20px;
  border-radius: 8px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border-radius: 8px;
  background: conic-gradient(from 210deg, var(--navy), var(--teal), var(--amber), var(--navy));
  color: #fff;
  font-size: 34px;
  font-weight: 800;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.22;
}

.identity-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 143, 138, 0.15);
}

.login-view {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 460px);
  gap: 24px;
  align-items: stretch;
  min-height: 440px;
}

.login-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  padding: 28px 6px;
}

.login-copy h2 {
  font-size: clamp(32px, 5vw, 56px);
  max-width: 620px;
}

.login-copy p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
  border-radius: 8px;
}

.primary-button,
.secondary-button,
.text-button,
.punch-button {
  border: 0;
  border-radius: 6px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--navy);
  color: #fff;
}

.primary-button:disabled,
.secondary-button:disabled,
.punch-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  background: var(--teal);
  color: #fff;
}

.button-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
}

.hint,
.muted {
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.google-button-slot {
  min-height: 1px;
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
}

.clock {
  display: grid;
  justify-items: end;
  color: var(--muted);
}

.clock strong {
  color: var(--ink);
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.punch-button {
  display: grid;
  gap: 12px;
  min-height: 168px;
  padding: 24px;
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow);
}

.punch-button.in {
  background: linear-gradient(135deg, var(--green), #1d695f);
}

.punch-button.out {
  background: linear-gradient(135deg, var(--navy), #345b75);
}

.punch-button span {
  font-size: 22px;
  font-weight: 900;
}

.punch-button strong {
  align-self: end;
  font-size: 30px;
}

.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.punch-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(21, 50, 74, 0.18);
}

.late-alert {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  color: #6d4a15;
}

.records-section {
  padding: 20px;
  border-radius: 8px;
}

.leave-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.leave-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
}

.leave-form h2,
.leave-records h2 {
  margin-bottom: 0;
}

.leave-records table {
  min-width: 980px;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.text-button {
  min-height: 46px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #edf3f6;
  color: var(--navy);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status-pill.ok {
  background: rgba(47, 143, 78, 0.12);
  color: var(--green);
}

.status-pill.late {
  background: rgba(195, 64, 64, 0.12);
  color: var(--red);
}

.status-pill.open {
  background: rgba(242, 169, 59, 0.18);
  color: #9a6414;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding: 14px 0;
  }

  .topbar,
  .login-view,
  .leave-layout,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .identity-panel {
    grid-template-columns: 1fr;
  }

  .brand {
    min-height: auto;
  }

  .status-band,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .clock {
    justify-items: start;
  }

  .punch-button {
    min-height: 132px;
  }
}
