:root {
  --ink: #1c2430;
  --muted: #5e6a78;
  --line: #e4ddd2;
  --paper: #f6f3ee;
  --card: #fffcf8;
  --accent: #0f6e6b;
  --accent-dark: #0b5552;
  --warn: #9a4d16;
  --bad: #8d2f2f;
  --ok: #1d6b45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Cairo", Tahoma, sans-serif;
}

button, input {
  font: inherit;
}

a { color: var(--accent-dark); }

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong { font-size: 1.35rem; }

.brand span, .muted { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field.full { grid-column: 1 / -1; }

label { font-weight: 600; }

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

button, .button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button.secondary, .button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.danger { background: var(--bad); }

button:disabled { opacity: 0.6; cursor: wait; }

.actions, .row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #fff4e8;
  color: var(--warn);
}

.alert.ok { background: #e8f6ee; color: var(--ok); }
.alert.bad { background: #fdecec; color: var(--bad); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card { width: min(460px, 100%); }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.tabs button { flex: 1; }

.tabs button.active { background: var(--accent); color: white; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: right;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-block;
  background: #e7f4f3;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.9rem;
}

.qr {
  width: min(260px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.empty { color: var(--muted); }

.employee { margin-bottom: 12px; }

.total { font-size: 1.15rem; }

#reader { width: min(360px, 100%); margin: 12px auto; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .top { align-items: flex-start; }
}

@media print {
  body * { visibility: hidden; }
  #print-sheet, #print-sheet * { visibility: visible; }
  #print-sheet {
    position: absolute;
    inset: 0;
    background: white;
    text-align: center;
    padding: 40px;
  }
}
