*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f4f6f9;
  --surface:  #ffffff;
  --border:   #e1e4e8;
  --primary:  #1d6fa4;
  --primary-h:#155d8a;
  --danger:   #c0392b;
  --success:  #27ae60;
  --warning:  #e67e22;
  --text:     #1a1a2e;
  --muted:    #6b7280;
  --radius:   8px;
  --shadow:   0 1px 4px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
  min-height: 100vh;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 520px;
}

.card--wide { max-width: 860px; }

/* ── Header ─────────────────────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: 28px;
}

.header__logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.header__sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: .9rem;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--text);
  transition: border-color .15s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,111,164,.12);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary   { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-h); }
.btn--danger    { background: var(--danger);  color: #fff; }
.btn--danger:hover:not(:disabled)  { background: #a93226; }
.btn--success   { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { background: #219a52; }
.btn--ghost     { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn--ghost:hover:not(:disabled)   { background: rgba(29,111,164,.06); }
.btn--full { width: 100%; }
.btn--sm   { padding: 7px 14px; font-size: .82rem; }

/* ── Tech picker ────────────────────────────────────────────────────────── */

.tech-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.tech-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  width: 100%;
  text-align: left;
}

.tech-btn:hover {
  border-color: var(--primary);
  background: #edf4fb;
}

.tech-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tech-name { font-weight: 600; font-size: .95rem; }
.tech-avail { font-size: .8rem; color: var(--success); margin-top: 2px; }

/* ── Status badges ──────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge--pending  { background: #fef3c7; color: #92400e; }
.badge--ready    { background: #dbeafe; color: #1e40af; }
.badge--active   { background: #d1fae5; color: #065f46; }
.badge--closed   { background: #f3f4f6; color: var(--muted); }

/* ── Session table (dashboard) ───────────────────────────────────────────── */

.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.session-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.session-card__info { flex: 1; min-width: 180px; }
.session-card__machine { font-weight: 600; font-size: .95rem; }
.session-card__meta   { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.session-card__actions { display: flex; gap: 8px; }

/* ── Status page ────────────────────────────────────────────────────────── */

.status-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 12px;
}

.status-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.status-body {
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ───────────────────────────────────────────────────────────────── */

.error-msg {
  color: var(--danger);
  font-size: .85rem;
  margin-top: 8px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.empty {
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  font-size: .9rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar__title { font-size: 1.1rem; font-weight: 700; }

.pill-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--success);
  font-weight: 600;
}

.pill-online::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

.download-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-top: 20px;
  background: var(--bg);
}

.download-box p { margin-bottom: 14px; color: var(--muted); font-size: .9rem; }
.download-box .btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 500px) {
  .card { padding: 20px 16px; }
  .session-card { flex-direction: column; align-items: flex-start; }
}
