:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-elevated-soft: #020617;
  --border-subtle: #4b5563;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #ea580c;
  --accent-soft: rgba(234, 88, 12, 0.15);
  --online: #34d399;
  --offline: #f97373;
  --online-sms: #60a5fa;
}

/* ====== GLOBAL ====== */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 24px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-main);
  position: relative;

  /* Background image + dark overlay */
  background:
    url('/images/simpleBG.png') center center / cover no-repeat fixed,
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.9) 0, rgba(2, 6, 23, 0.98) 55%, #020617 100%);
}

/* A simple layout wrapper for all pages */
.page {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1; /* keep content above the decorative panel */
}

/* Titles/subtitles */
h1 {
  margin: 0 0 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
}

small {
  color: var(--text-muted);
}

/* Error banner */
#error {
  color: var(--offline);
  margin-top: 12px;
  display: none;
}

/* ====== TABLES / DASHBOARD ====== */

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 16px;
  background: var(--bg-elevated-soft);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

th,
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  vertical-align: top;
}

th {
  text-align: left;
  background: linear-gradient(to right, #111827, #030712);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

/* Stronger hover state */
tbody tr {
  transition: background-color 0.15s ease, transform 0.05s ease, border-left-color 0.15s ease;
}

tbody tr:hover {
  background-color: rgba(31, 41, 55, 0.96); /* much lighter vs bg */
  border-left: 3px solid var(--accent);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-title .pulse-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Status colours */
.status-online {
  color: var(--online);
  font-weight: 600;
}

.status-offline {
  color: var(--offline);
  font-weight: 600;
}

/* Details toggle button */
.details-toggle {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
  color: var(--accent);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.details-toggle:hover {
  background: var(--accent);
  color: #020617;
  transform: translateY(-1px);
}

/* Details rows */
.details-row {
  display: none;
  background: #020617;
}

.details-inner {
  font-size: 13px;
  color: var(--text-main);
}

/* Inner activity table */
.details-inner table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 4px;
  background: #020617;
}

.details-inner th,
.details-inner td {
  padding: 4px 8px;
  border-bottom: 1px solid #374151;
  font-size: 12px;
}

.details-inner th {
  background: #030712;
  color: var(--text-muted);
}

/* Clear hover on activity rows too */
.details-inner tbody tr:hover {
  background-color: #111827;
}

.details-inner td.flag {
  text-align: center;
  width: 70px;
}

.details-inner td.flag span {
  font-weight: 600;
}

.details-inner td.flag span.x-online {
  color: var(--online);
}

.details-inner td.flag span.x-online-sms {
  color: var(--online-sms);
}

.details-inner td.flag span.x-offline {
  color: var(--offline);
}

/* Timestamp column */
.details-inner td.ts {
  white-space: nowrap;
  color: var(--text-muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.user-chip-main {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.user-chip-main span {
  font-size: 13px;
}
.user-chip-main small {
  color: #b0b0b0;
  font-size: 12px;
}

/* ====== BUTTONS (for login, etc.) ====== */
.btn-outline {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #444;
  background: transparent;
  color: #f3f3f3;
  font-size: 12px;
  cursor: pointer;
}
.btn-outline:hover {
  border-color: #ff9340;
  color: #ffb470;
}
.btn-primary {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: #ff9340;
  color: #0c0c0c;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary:hover {
  background: #ffa755;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #020617;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary:hover {
  background: #c2410c;
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.45);
  transform: translateY(-1px);
}
/* ---------- App header ---------- */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 28px;
  margin: 0;
  color: var(--accent, #ff9340);
}

.app-title .pulse-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.app-title span {
  font-weight: 600;
}

.app-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0ca3b0;
  color: #ffffff;
  font-weight: 600;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 13px;
}

.user-email {
  font-size: 12px;
  color: #b0b0b0;
}

.app-header-link {
  font-size: 12px;
  color: var(--accent, #ff9340);
  text-decoration: none;
  margin-left: 8px;
}

.app-header-link:hover {
  text-decoration: underline;
}

.app-header-signout {
  padding: 4px 10px;
  font-size: 12px;
}

/* ====== LOGIN / SPLASH ====== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.auth-card {
  background: #020617;
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.7);
  border: 1px solid #4b5563;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}

.auth-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
