/* ==========================================================================
   Cryptonic UI - dashboard-ui.css
   Sections:
   1) Base / Reset
   2) Layout Shell
   3) Sidebar
   4) Top Bar
   5) Main Content / Content Grid
   6) Cards
   7) Fields & Form Elements
   8) Buttons
   9) Dashboard / Info tab meta
   10) Auth & Landing (login, register, index)
   11) Mouse / Advanced controls
   12) Log / Tables / Misc
   13) Responsive tweaks
   ========================================================================== */

/* ===== Base / Reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020713;
  color: #e5e7eb;
}

/* Thin glowing bar at the very top */
.brand-bar {
  height: 4px;
  background: linear-gradient(90deg, #00f2ff, #00ffb7);
}

/* ===== Layout Shell ===== */
.app-shell {
  display: flex;
  min-height: calc(100vh - 4px);
  background: radial-gradient(circle at top, #071622 0, #020713 55%);
}

/* ===== Sidebar ===== */
.sidebar {
  width: 230px;
  background: radial-gradient(circle at top left, #0b1f33 0, #020713 52%);
  border-right: 1px solid #0f2838;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nav-bottom {
  margin-top: auto; /* pushes Account to bottom */
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: radial-gradient(circle, #00f2ff 0, #00111a 58%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.7);
  overflow: hidden;
}

.logo-img {
  width: 36px;
  height: 36px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: #9ca3af;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

/* Nav item buttons in sidebar */
.nav-item {
  width: 100%;
  border: none;
  outline: none;
  padding: 7px 9px;
  border-radius: 8px;
  background: transparent;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}

.nav-item span {
  pointer-events: none;
}

.nav-item .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1f2937;
}

.nav-item:hover {
  background: #0c2637;
  transform: translateX(1px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 242, 255, 0.15), transparent);
  color: #ffffff;
}

.nav-item.active .nav-dot {
  background: #00f2ff;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #10293a;
  padding-top: 10px;
  font-size: 0.8rem;
}

.sidebar-label {
  color: #9ca3af;
  margin-bottom: 2px;
}

.sidebar-value {
  color: #e5e7eb;
  font-weight: 500;
}

/* ===== Main Layout ===== */
.main-area {
  flex: 1;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Top Bar ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, #071525 0, #020713 60%);
  border: 1px solid #0f2838;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6);
}

.top-bar-left h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.top-bar-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 2px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-label {
  font-size: 0.75rem;
  color: #9ca3af;
}

.status-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(54, 54, 54, 0.8);
}

/* ===== Content Grid ===== */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 12px;
  align-items: flex-start;
}

.card-wide {
  grid-column: 1 / -1;
}

/* ===== Cards ===== */
.card {
  position: relative;
  border-radius: 12px;
  background: radial-gradient(circle at top left, #020617 0, #020713 55%);
  border: 1px solid #0f2838;
  padding: 10px 12px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65);
}

.card-header {
  margin-bottom: 10px;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.card-header p {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ===== Fields & Form Elements ===== */
.field {
  margin-bottom: 8px;
}

.field label {
  display: block;
  font-size: 0.76rem;
  color: #9ca3af;
  margin-bottom: 2px;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Number inputs and select styling (used in advanced controls) */
.field input[type="number"],
.field select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #1e3a4c;
  background: #020713;
  color: #e5e7eb;
}

/* two-column groups for advanced Move Event */
.field-group-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}

/* ===== Buttons ===== */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #020713;
  color: #e5e7eb;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease,
    border-color 0.12s ease;
}

/* Primary, secondary, ghost */
.btn-primary {
  background: linear-gradient(135deg, #00f2ff, #00ffb793);
  color: #020617;
  border-color: rgba(15, 23, 42, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.btn-secondary {
  background: #020713;
  border-color: #00f2ff50;
}

.btn-ghost {
  background: transparent;
  border-color: #1f2937;
  color: #9ca6af;
}

/* Shared hover behavior */
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0px 0px 5px rgb(76, 139, 155);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-small {
  padding: 4px 8px;
  font-size: 0.75rem;
}

/* Profile selector (currently optional / advanced) */
.profile-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-profile {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 999px;
  background: #020713;
  border: 1px solid #1f2937;
  color: #9ca3af;
  cursor: pointer;
}

/* ===== Dashboard / Info Meta ===== */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
}

.overview-right {
  font-size: 0.78rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.metric-label {
  color: #9ca3af;
}

.metric-value {
  font-weight: 500;
}

/* Meta rows used in info tab */
.controller-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.meta-label {
  color: #9ca3af;
}

.meta-value {
  font-weight: 500;
}

/* Status badge reused for server / mouse, already defined above */

/* Muted helper */
.muted {
  color: #9ca3af;
}

.tiny {
  font-size: 0.78rem;
}

/* ===== Mouse / Advanced controls (optional) ===== */
/* You can use these for the mouse tab when you hook your C++ / overlay. */

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.control-label {
  font-size: 0.78rem;
  color: #9ca3af;
}

.control-value {
  font-size: 0.78rem;
}

/* ===== Log ===== */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.log {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid #0f2838;
  background: #020713;
  padding: 6px 8px;
  font-size: 0.76rem;
}

.log-line {
  color: #9ca3af;
  margin-bottom: 2px;
}

.log-line strong {
  color: #e5e7eb;
}

/* ===== Table-like layout (used by keys/users etc.) ===== */
.table-like {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.table-like th,
.table-like td {
  padding: 6px 8px;
  border-bottom: 1px solid #0b1c28;
}

.table-like th {
  text-align: left;
  color: #9ca3af;
  font-weight: 500;
}

.table-like tbody tr:hover {
  background: rgba(15, 23, 42, 0.6);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid #0f2838;
  }

  .sidebar-logo {
    margin-bottom: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0;
    margin-left: 8px;
  }

  .sidebar-footer {
    margin-top: 0;
    margin-left: auto;
    border-top: none;
    padding-top: 0;
  }

  .main-area {
    padding: 14px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ===== Auth & Landing Layouts (login, register, index) ===== */

.auth-shell {
  min-height: calc(100vh - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
}

/* Landing (index) uses the same centered style but can be a bit wider */
.landing-shell {
  min-height: calc(100vh - 4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 16px;
}

.landing-card {
  width: 100%;
  max-width: 560px;
}

/* Small header used on auth + landing cards */
.auth-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-header-text-main {
  font-size: 1rem;
  font-weight: 600;
}

.auth-header-text-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Inputs used on auth / landing forms */
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="search"],
.field input[type="tel"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #1e3a4c;
  background: #020713;
  color: #e5e7eb;
}

.field input[type="text"]::placeholder,
.field input[type="password"]::placeholder,
.field input[type="email"]::placeholder {
  color: #6b7280;
}

.field input[type="text"]:focus,
.field input[type="password"]:focus,
.field input[type="email"]:focus,
.field input[type="number"]:focus,
.field select:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.45);
}
/* ===== Live Chat ===== */

.chat-box {
  border-radius: 10px;
  border: 1px solid #0f2838;
  background: #020713;
  display: flex;
  flex-direction: column;
  height: 680px; /* one big box */
}

.chat-messages {
  flex: 1;
  overflow-y: auto;

  padding: 8px 10px;
  font-size: 0.78rem;
}

.chat-message {
  margin-bottom: 4px;
}

.chat-message-meta {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 1px;
}

.chat-message-body {
  word-wrap: break-word;
  word-break: break-word;
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid #0f2838;
  padding: 6px 8px;
}

.chat-input {
  flex: 1;
}

/* reuse existing input styles for chat */
.chat-input input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #1e3a4c;
  background: #020713;
  color: #e5e7eb;
}

.chat-input input[type="text"]::placeholder {
  color: #6b7280;
}
.chat-input input[type="text"]:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.45);
}
.chat-message-system .chat-message-meta {
  color: #22d3ee;
}

.chat-message-system .chat-message-body {
  color: #e5e7eb;
  font-style: italic;
}
.chat-message-user .chat-message-meta {
  color: #34d399;
}

