:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3f57;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #e85d2c;
  --accent-hover: #ff7340;
  --ok: #3ecf8e;
  --bad: #f25f5c;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse at top, #1a2740 0%, var(--bg) 55%);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.login-card {
  max-width: 400px;
  margin: 8vh auto 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #c43d12);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
}

input:focus {
  outline: 2px solid rgba(232, 93, 44, 0.45);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-enter {
  background: var(--accent);
  color: #fff;
  min-width: 88px;
}

.btn-enter:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-enter:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.error {
  background: rgba(242, 95, 92, 0.12);
  border: 1px solid rgba(242, 95, 92, 0.35);
  color: #ffb4b2;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.num {
  color: var(--muted);
  width: 48px;
}

.name-input {
  width: 100%;
  min-width: 140px;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
}

.name-input:hover {
  border-color: var(--border);
  background: var(--surface2);
}

.name-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.badge-online {
  background: rgba(62, 207, 142, 0.12);
  color: var(--ok);
}

.badge-online::before {
  background: var(--ok);
}

.badge-offline {
  background: rgba(242, 95, 92, 0.12);
  color: var(--bad);
}

.badge-offline::before {
  background: var(--bad);
}

.badge-busy {
  background: rgba(139, 156, 179, 0.15);
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 0.35rem;
}

.actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}
