*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #202437, #05060a 60%);
  color: #f5f5f5;
}

a {
  color: #8ea6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  backdrop-filter: blur(16px);
  background: linear-gradient(90deg, rgba(10,10,24,0.9), rgba(9,9,20,0.6));
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
}

.logo span {
  color: #8ea6ff;
}

.topbar nav a {
  margin-left: 16px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.topbar nav a:hover {
  opacity: 1;
}

.content {
  padding: 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.auth-card {
  max-width: 360px;
  margin: 80px auto;
  padding: 24px 28px;
  background: rgba(11, 11, 25, 0.9);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.05);
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form label {
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(4,4,12,0.85);
  color: #fff;
}

.form input:focus {
  outline: none;
  border-color: #8ea6ff;
  box-shadow: 0 0 0 1px rgba(142,166,255,0.5);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  color: #f5f5f5;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #8ea6ff, #5f6df4);
  color: #020308;
}

.btn.small {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn.danger {
  background: linear-gradient(135deg, #ff6a6a, #c83a3a);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.alert {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.alert-error {
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.5);
  color: #ffc8c8;
}

.muted {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Panels */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  background: rgba(8, 8, 20, 0.9);
  border-radius: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
}

.stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  min-width: 90px;
}

.stat .label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.stat .value {
  display: block;
  font-size: 1.1rem;
  margin-top: 2px;
}

.stat .value.online {
  color: #8dea9b;
}

.pill-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  font-size: 0.85rem;
}

.pill:hover {
  background: rgba(255,255,255,0.08);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.table th {
  text-align: left;
  opacity: 0.7;
  font-weight: 500;
}

.table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.actions {
  display: flex;
  gap: 6px;
}

.config-content {
  display: none;
  width: 100%;
  margin-top: 6px;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px;
  max-height: 80px;
  resize: vertical;
}

.config-content.show {
  display: block;
}

/* --- BUTTON BASE STYLES --- */
.btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px; /* Slightly rounded corners */
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: none;
    text-align: center;
    text-decoration: none;
    display: inline-flex; /* Ensures content is centered */
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Subtle depth */
    margin: 2px 0; /* Add slight vertical spacing */
}

.btn.small {
    font-size: 12px;
    padding: 5px 10px;
    margin: 2px 4px; /* Add horizontal spacing for better separation */
}

/* --- BUTTON CONTAINER FIX --- */
.actions-col {
    /* Use flexbox to align buttons neatly within the cell */
    display: flex;
    flex-wrap: wrap; /* Allows buttons to wrap if the screen is narrow */
    gap: 4px; /* Space between buttons */
    align-items: center;
}

/* --- COLOR STYLES --- */

/* Primary Button (Publish / Unpublish) */
.btn.primary {
    /* Muted Blue/Purple for dark mode */
    background-color: #6a6aff; 
    color: #ffffff;
}
.btn.primary:hover {
    background-color: #7d7dff; /* Slightly brighter on hover */
    box-shadow: 0 1px 6px rgba(106, 106, 255, 0.4);
}

/* Danger Button (Delete) */
.btn.danger {
    /* Soft Red/Pink for dark mode */
    background-color: #e55c5c;
    color: #ffffff;
}
.btn.danger:hover {
    background-color: #ff6a6a; /* Brighter red on hover */
    box-shadow: 0 1px 6px rgba(229, 92, 92, 0.4);
}

/* Secondary Button (View/Copy) */
.btn.small:not(.primary):not(.danger) {
    background-color: #333940; /* Darker grey background */
    color: #b0b8c2;
    border: 1px solid #454d56;
}
.btn.small:not(.primary):not(.danger):hover {
    background-color: #454d56;
    color: #ffffff;
    box-shadow: none;
}