:root{
  --bg:#0b1220;
  --card:#0f1a2f;
  --text:#e8eefc;
  --muted:#a8b3d6;
  --primary:#3b82f6;
  --primary2:#1d4ed8;
  --ok:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
  --border:rgba(255,255,255,0.08);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(59,130,246,0.25), transparent 50%),
              radial-gradient(900px 500px at 90% 10%, rgba(34,197,94,0.18), transparent 45%),
              var(--bg);
  color:var(--text);
}

.container{
  max-width: 520px;
  margin: 32px auto;
  padding: 0 16px;
}
.container.wide{max-width: 1100px}

.topbar{
  position: sticky; top: 0;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,0.7);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.topbar-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.topbar-title{font-weight:700; letter-spacing:0.2px}
.topbar-right{display:flex; align-items:center; gap:12px}
.link{color: var(--muted); text-decoration:none}
.link:hover{color: var(--text)}

.card{
  background: rgba(15,26,47,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.brand{
  display:flex; gap:14px; align-items:center; margin-bottom: 14px;
}
.logo{
  width:44px;height:44px;border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, var(--primary), rgba(34,197,94,0.6));
  font-weight:800;
}
.title{font-size:18px; font-weight:800}
.subtitle{font-size:13px; color: var(--muted); margin-top: 2px}

.form label{display:block; margin:12px 0 6px; color: var(--muted); font-size:13px}
.form input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline:none;
}
.form input:focus{border-color: rgba(59,130,246,0.6)}

.btn{
  width:100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  cursor:pointer;
  transition: transform 0.05s ease, opacity 0.2s ease;
}
.btn:active{transform: scale(0.99)}
.btn:disabled{opacity:0.45; cursor:not-allowed}
.btn-primary{background: linear-gradient(135deg, var(--primary), var(--primary2)); color:white}
.btn-secondary{background: rgba(255,255,255,0.10); color: var(--text); border:1px solid var(--border)}
.btn-big{padding: 16px 16px; font-size: 18px}

.footer-note{margin-top:14px; color: var(--muted); font-size: 12px; line-height: 1.45}

.alert{padding: 10px 12px; border-radius: 12px; margin: 10px 0 14px; border: 1px solid var(--border)}
.alert-danger{background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.35); color: #ffd1d1}

.section{padding: 10px 0}
.actions{display:grid; grid-template-columns: 1fr; gap: 12px}
.muted{color: var(--muted); font-size: 13px}

.kpi{
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
}
.kpi-label{color: var(--muted); font-size: 13px}
.kpi-value{font-size: 26px; font-weight: 900; margin-top: 3px}
.kpi-value.ok{color: var(--ok)}
.kpi-value.warn{color: var(--warn)}
.kpi-sub{color: var(--muted); margin-top: 4px; font-size: 13px}
.kpi-date{color: var(--muted); font-weight: 700}
.kpi-value.danger{color: var(--danger)}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 980px){
  .grid{grid-template-columns: 1.2fr 1fr}
}

.card-header{
  display:flex; align-items:flex-start; justify-content:space-between; gap: 12px;
  margin-bottom: 10px;
}
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(34,197,94,0.12);
  color: var(--ok);
  font-weight: 800;
  font-size: 12px;
}
.badge.badge-warn{
  background: rgba(245,158,11,0.12);
  color: var(--warn);
}

.pill{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 700;
}

.list{display:flex; flex-direction:column; gap: 10px}
.list-item{
  display:flex; justify-content:space-between; align-items:center;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.12);
}
.list-item .name{font-weight: 800}
.list-item .time{color: var(--muted); font-weight: 700; font-size: 13px}
.empty{color: var(--muted); padding: 12px}

.table{display:flex; flex-direction:column; gap: 6px}
.table-row{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.10);
  font-size: 13px;
}
.table-head{
  background: rgba(255,255,255,0.06);
  font-weight: 900;
  color: var(--muted);
}

/* --- NYT: status dots + layout --- */
.dot{
  width:10px;height:10px;
  border-radius:999px;
  display:inline-block;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.15) inset;
  flex: 0 0 auto;
}

.dot-in{ background: rgba(34,197,94,0.95); }
.dot-out{ background: rgba(239,68,68,0.95); }
.dot-missing{ background: rgba(168,179,214,0.85); }
.dot-total{ background: rgba(59,130,246,0.85); }

.stats{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.stat{
  display:flex; align-items:center; gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
}
.stat strong{ color: var(--text); }

.status-item{ align-items:flex-start; }
.status-left{
  display:flex; gap:10px; align-items:flex-start;
}
.status-sub{
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.status-right{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  height: fit-content;
}

.role-tag{
  margin-left: 8px;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}

/* Status badge modes */
.badge-live{
  background: rgba(34,197,94,0.12);
  color: var(--ok);
}

.badge-reconnect{
  background: rgba(245,158,11,0.14);
  color: var(--warn);
}

.badge-fallback{
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  border-color: rgba(255,255,255,0.14);
}
/* Smaller button */
.btn-sm{ padding: 8px 10px; border-radius: 12px; font-size: 13px; font-weight: 800; }

/* Danger button */
.btn-danger{
  background: rgba(239,68,68,0.14);
  border: 1px solid rgba(239,68,68,0.35);
  color: #ffd1d1;
}

/* Modal */
.modal{ position: fixed; inset: 0; display: none; z-index: 50; }
.modal[aria-hidden="false"]{ display: block; }
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,0.55);
}
.modal-panel{
  position: relative;
  width: min(720px, calc(100% - 24px));
  margin: 60px auto;
  background: rgba(15,26,47,0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-header{
  display:flex; align-items:flex-start; justify-content:space-between; gap: 12px;
  margin-bottom: 10px;
}
.modal-close{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 0;
}
body.modal-open{ overflow: hidden; }

/* --- Kiosk / employee avatars --- */
.avatar{
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  overflow: hidden;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.avatar.avatar-lg{
  width: 140px;
  height: 140px;
  border-radius: 22px;
}
.avatar img{ width: 100%; height: 100%; object-fit: cover; display:block; }

.kiosk-shell{
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.kiosk-top{
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,0.74);
  border-bottom: 1px solid var(--border);
}
.kiosk-top-inner{
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kiosk-title{
  display:flex;
  align-items:center;
  gap: 12px;
  font-weight: 900;
}
.kiosk-clock{ color: var(--muted); font-weight: 800; }

.kiosk-container{
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  width: 100%;
}
.kiosk-grid{
  display: grid;
  gap: 16px;
  /* Auto-wrap tiles across the screen (tablet-friendly) */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: stretch;
}

.kiosk-emp{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(0,0,0,0.12);
  cursor: pointer;
  user-select: none;
  text-align: center;
  min-height: 240px;
}
.kiosk-emp:active{ transform: scale(0.99); }
.kiosk-emp .emp-meta{ width: 100%; min-width: 0; }
.kiosk-emp .emp-name{ font-weight: 900; }
.kiosk-emp .emp-sub{ color: var(--muted); font-size: 12px; margin-top: 4px; }

.pin-dots{
  -webkit-text-security: disc;
  letter-spacing: 0.30em;
  font-weight: 900;
  text-align: center;
  font-size: 22px;
}

.keypad{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.key{
  padding: 14px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-weight: 900;
  font-size: 20px;
  cursor: pointer;
}
.key:active{ transform: scale(0.99); }
.key.key-wide{ grid-column: span 2; }

