:root {
  --blue: #205ec9;
  --blue-dark: #174ba5;
  --blue-pale: #edf3ff;
  --ink: #192338;
  --muted: #697386;
  --line: #dce3ef;
  --surface: #ffffff;
  --page: #f3f6fb;
  --green: #16804a;
  --green-pale: #e6f7ed;
  --red: #c84040;
  --red-pale: #fdecec;
  --yellow: #976b0a;
  --yellow-pale: #fff5d8;
  --shadow: 0 10px 32px rgba(28, 46, 83, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------
   Watermark logos
   -------------------------------------------------------------- */

.watermark-layer {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.watermark {
  position: absolute;
  width: min(32vw, 170px);
  height: min(32vw, 170px);
  object-fit: contain;
  opacity: 0.055;
  filter: grayscale(0.15);
}

.watermark-company {
  top: 14%;
  left: -4%;
  transform: rotate(-20deg);
}

.watermark-category {
  right: -3%;
  bottom: 12%;
  transform: rotate(18deg);
}

/* --------------------------------------------------------------
   Shell and cards
   -------------------------------------------------------------- */

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px 34px;
}

.card,
.login-card {
  border: 1px solid rgba(220, 227, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.card {
  margin-bottom: 16px;
  padding: 20px;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 54px);
  place-items: center;
}

.login-card {
  width: 100%;
  max-width: 470px;
  padding: 26px;
}

/* --------------------------------------------------------------
   Typography
   -------------------------------------------------------------- */

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

h1 {
  margin-bottom: 5px;
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.27;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--blue);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.115em;
}

.muted,
.intro {
  color: var(--muted);
  line-height: 1.52;
}

.intro {
  margin-bottom: 22px;
}

.small-muted {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

/* --------------------------------------------------------------
   Login and top header
   -------------------------------------------------------------- */

.login-brand {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.login-company-logo,
.login-category-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 13px;
  background: #f4f7fc;
}

.brand-copy h1 {
  margin: 0;
}

.brand-copy .eyebrow {
  margin-bottom: 2px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin: 7px 0 20px;
}

.employee-heading {
  min-width: 0;
}

#employee-meta {
  margin-bottom: 0;
  font-size: 16px;
}

.signout-button {
  min-width: 94px;
  min-height: 50px;
  flex: 0 0 auto;
  padding: 10px 13px;
}

/* --------------------------------------------------------------
   Inputs and buttons
   -------------------------------------------------------------- */

label {
  display: block;
  margin: 16px 0 7px;
  color: #344054;
  font-weight: 750;
  font-size: 14px;
}

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

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32, 94, 201, 0.15);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 66px;
}

.text-button {
  position: absolute;
  top: 50%;
  right: 7px;
  padding: 7px 9px;
  transform: translateY(-50%);
  color: var(--blue);
  border: 0;
  background: transparent;
  font-weight: 800;
  font-size: 13px;
}

.primary-button,
.outline-button,
.success-button,
.danger-button,
.icon-button {
  min-height: 48px;
  border-radius: 12px;
  font-weight: 800;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.primary-button,
.success-button,
.danger-button {
  color: #fff;
  border: 1px solid transparent;
}

.primary-button {
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.outline-button,
.icon-button {
  color: var(--blue);
  border: 1px solid #bdcce8;
  background: #fff;
}

.success-button {
  background: var(--green);
}

.danger-button {
  background: var(--red);
}

.full-button {
  width: 100%;
  margin-top: 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.icon-button {
  display: grid;
  width: 48px;
  min-height: 48px;
  padding: 0;
  place-items: center;
  font-size: 24px;
}

/* --------------------------------------------------------------
   Tab navigation
   -------------------------------------------------------------- */

.tab-nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 5px 18px rgba(28, 46, 83, 0.04);
}

.tab-button {
  min-width: 82px;
  flex: 1;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--muted);
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-weight: 800;
  font-size: 13px;
}

.tab-button.active {
  color: var(--blue);
  background: var(--blue-pale);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --------------------------------------------------------------
   General UI blocks
   -------------------------------------------------------------- */

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

.status-box,
.location-status {
  padding: 15px;
  border-radius: 14px;
  background: #f4f6fa;
  line-height: 1.55;
}

.status-box.good,
.location-status.good {
  color: #126437;
  border: 1px solid #b7e6c7;
  background: var(--green-pale);
}

.status-box.bad,
.location-status.bad {
  color: #a22a2a;
  border: 1px solid #efc4c4;
  background: var(--red-pale);
}

.status-box.warning,
.location-status.warning {
  color: var(--yellow);
  border: 1px solid #eed48b;
  background: var(--yellow-pale);
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.form-message.error {
  color: var(--red);
}

.form-message.success {
  color: var(--green);
}

.badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--muted);
  border-radius: 999px;
  background: #eef2f7;
  font-weight: 800;
  font-size: 12px;
}

/* --------------------------------------------------------------
   Work mode and office confirmation
   -------------------------------------------------------------- */

.work-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.mode-option {
  margin: 0;
  cursor: pointer;
}

.mode-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-option span {
  display: grid;
  min-height: 50px;
  padding: 10px;
  place-items: center;
  color: #344054;
  border: 1px solid #d1d9e6;
  border-radius: 12px;
  background: #fff;
  font-weight: 800;
  text-align: center;
}

.mode-option input:checked + span {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-pale);
  box-shadow: 0 0 0 2px rgba(32, 94, 201, 0.08);
}

.office-confirmation {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d7dfec;
  border-radius: 13px;
  background: #f8faff;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.48;
}

.checkbox-row input {
  width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
}

/* --------------------------------------------------------------
   Camera
   -------------------------------------------------------------- */

#camera-preview,
.selfie-preview {
  display: block;
  width: 100%;
  min-height: 250px;
  max-height: 430px;
  margin-top: 14px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 15px;
  background: #172033;
}

.camera-actions,
.attendance-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.camera-actions button,
.attendance-actions button {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  margin: 0;
}

/* --------------------------------------------------------------
   Detail lists and records
   -------------------------------------------------------------- */

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f5;
  font-size: 14px;
}

.detail-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
}

.detail-value {
  text-align: right;
  font-weight: 800;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.record-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.record-name {
  font-weight: 800;
}

.record-date,
.record-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 99px;
  color: #44516a;
  background: #edf1f6;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.active,
.status-pill.approved {
  color: #126437;
  background: var(--green-pale);
}

.status-pill.pending {
  color: var(--yellow);
  background: var(--yellow-pale);
}

.empty-state {
  padding: 17px 8px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 380px) {
  .app-shell {
    padding: 14px 12px 28px;
  }

  .card,
  .login-card {
    padding: 17px;
  }

  .topbar {
    gap: 10px;
  }

  .signout-button {
    min-width: 78px;
  }

  .tab-button {
    min-width: 74px;
    font-size: 12px;
  }

  .watermark {
    width: 110px;
    height: 110px;
  }
}