@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --accent: #ff7b00;
  --accent-dim: rgba(255, 123, 0, 0.12);
  --signal-red: #ff4d6d;
  --signal-amber: #ffb703;
  --signal-green: #52b788;
  --bg: #0d0b09;
  --bg-panel: #15110d;
  --bg-surface: #211a14;
  --bg-hover: #2b2219;
  --border: rgba(255, 123, 0, 0.15);
  --border-hard: rgba(255, 123, 0, 0.3);
  --border-panel: rgba(255, 255, 255, 0.05);
  --text: #fff7f0;
  --muted: #d4a373;
  --faint: #6b4e2e;
  --font-display: -apple-system, "Manrope", sans-serif;
  --font-mono: -apple-system, "Roboto", sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
}

a {
  text-decoration: none;
  color: var(--accent);
  font-family: inherit;
  transition: color 0.2s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-display);
}

body {
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  background-image:
    linear-gradient(rgba(0, 212, 232, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 232, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

button,
input,
textarea {
  font-family: inherit;
}

.sidebar {
  width: 250px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar .logo {
  text-align: center;
  margin-bottom: 30px;
}

.sidebar .logo img {
  width: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sidebar .logo h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 10px;
  color: var(--text);
}

.sidebar nav {
  flex-grow: 1;
}

.sidebar nav a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 4px;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--border);
}

.sidebar .logout {
  background: transparent;
  color: var(--signal-red);
  border: 1px solid var(--signal-red);
  padding: 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    background 0.2s,
    color 0.2s;
}

.sidebar .logout:hover {
  background: var(--signal-red);
  color: var(--bg);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(0, 212, 232, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 232, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

.loading p {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.loader {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 123, 0, 0.2);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.main-content {
  flex-grow: 1;
  padding: 30px;
  margin-left: 250px;
}

.main-content h1 {
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

#totalUsers {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

th,
td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-panel);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

th {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  border-bottom: 1px solid var(--border);
}

td {
  color: var(--text-primary);
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-hover);
}

button {
  padding: 0.35rem 0.75rem;
  margin-right: 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  opacity: 1;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: #4fca7a;
  border: 1px solid #4fca7a;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-primary:hover {
  background: rgba(79, 202, 122, 0.15);
  color: #4fca7a;
  transform: none;
  text-decoration: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: var(--accent-dim);
  color: var(--accent);
  transform: none;
  text-decoration: none;
}

.statusBox {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
  border-left: 4px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out;
  margin-bottom: 15px;
}

.statusBox.error {
  background-color: #fee;
  border-left-color: #dc2626;
  color: #7f1d1d;
}

.statusBox.error::before {
  content: "";
  font-weight: bold;
  font-size: 18px;
  color: #dc2626;
  flex-shrink: 0;
}

.statusBox.success {
  background-color: #efe;
  border-left-color: #16a34a;
  color: #1b4332;
}

.statusBox.success::before {
  content: "";
  font-weight: bold;
  font-size: 18px;
  color: #16a34a;
  flex-shrink: 0;
}

.statusBox.info {
  background-color: #efe;
  border-left-color: #0891b2;
  color: #0c4a6e;
}

.statusBox.info::before {
  content: "";
  font-weight: bold;
  font-size: 18px;
  color: #0891b2;
  flex-shrink: 0;
}

#closeSMsg {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  margin: 0;
  width: 30px;
  height: 30px;
}

#closeSMsg:hover {
  color: var(--faint);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
    padding: 1.25rem 0.85rem;
  }

  .main-content {
    margin-left: 200px;
    padding: 1.75rem 2rem;
  }

  .sidebar .logo img {
    width: 44px;
  }

  .sidebar .logo h2 {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    flex-direction: column;
  }

  .sidebar .logo {
    margin-bottom: 1.25rem;
  }

  .sidebar .logo img {
    width: 44px;
  }

  .sidebar nav a {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.2rem;
  }

  .sidebar .logout {
    margin-top: 0.75rem;
    width: 100%;
    text-align: center;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .main-content h1 {
    font-size: 1.3rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th,
  td {
    padding: 0.7rem 0.85rem;
    font-size: 0.72rem;
  }

  button {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 0.85rem;
  }

  .sidebar .logo h2 {
    font-size: 0.85rem;
  }

  .main-content {
    padding: 1rem;
  }

  th,
  td {
    font-size: 0.68rem;
    padding: 0.6rem 0.75rem;
  }

  button {
    font-size: 0.62rem;
    padding: 0.25rem 0.5rem;
  }

  #messageBox {
    font-size: 0.72rem;
  }
}