/* ==============================================================================
   PC MCP - Desktop Dashboard Dark Theme
   ============================================================================== */

:root {
  --bg-app: #0e1017;
  --bg-sidebar: #13141e;
  --bg-card: #181a26;
  --bg-card-hover: #1e202f;
  --bg-input: #12131c;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: #7c4dff;
  
  --text-main: #f0f2f8;
  --text-muted: #8b8ea4;
  --text-dim: #5c5f76;
  
  --accent-purple: #7c4dff;
  --accent-purple-glow: rgba(124, 77, 255, 0.35);
  --accent-green: #00e676;
  --accent-green-glow: rgba(0, 230, 118, 0.4);
  --accent-yellow: #ffb300;
  --accent-red: #ff5252;
  --accent-red-bg: rgba(255, 82, 82, 0.15);
  --accent-red-hover: #ff3333;
  --accent-btn-stop: #68252f;
  --accent-btn-stop-hover: #822e3b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Fira Code', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
}

/* APP SHELL */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #448aff, #7c4dff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-purple-glow);
}

.app-title-group {
  display: flex;
  flex-direction: column;
}

.app-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.app-version {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background-color: rgba(124, 77, 255, 0.14);
  color: #fff;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  background-color: var(--accent-purple);
  border-radius: 0 4px 4px 0;
}

.nav-item .badge {
  margin-left: auto;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.red {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.status-dot.yellow {
  background-color: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow);
}

.btn-emergency-stop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background-color: var(--accent-btn-stop);
  border: 1px solid rgba(255, 82, 82, 0.2);
  border-radius: var(--radius-md);
  color: #ff8a80;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-emergency-stop:hover {
  background-color: var(--accent-btn-stop-hover);
  color: #fff;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  background-color: var(--bg-app);
  overflow-y: auto;
  padding: 28px 36px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* CARDS */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

/* STATUS HERO CARD */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
}

.status-card-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.glowing-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.45) 0%, rgba(0, 230, 118, 0.1) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.glowing-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 24px var(--accent-green-glow);
  animation: pulse 2.4s infinite ease-in-out;
}

.glowing-circle.red .glowing-inner {
  background-color: var(--accent-red);
  box-shadow: 0 0 24px rgba(255, 82, 82, 0.4);
}

.glowing-circle.yellow .glowing-inner {
  background-color: var(--accent-yellow);
  box-shadow: 0 0 24px rgba(255, 179, 0, 0.4);
}

@keyframes pulse {
  0% { transform: scale(0.96); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.96); opacity: 0.9; }
}

.status-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.status-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.status-uptime {
  font-size: 12px;
  color: var(--text-dim);
}

.status-card-right {
  display: flex;
  gap: 10px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--accent-purple);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-purple-glow);
}

.btn-primary:hover {
  background-color: #6d3aee;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background-color: var(--accent-btn-stop);
  border-color: rgba(255, 82, 82, 0.2);
  color: #ff8a80;
}

.btn-danger:hover {
  background-color: var(--accent-btn-stop-hover);
  color: #fff;
}

.btn-icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-tiny {
  background-color: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 4px;
  color: var(--text-main);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
}

.btn-tiny:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

.btn-block {
  width: 100%;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--accent-purple);
  font-size: 13px;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

/* CONNECTIVITY GRID */
.connectivity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.mini-status-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-status-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.mini-status-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 34px;
}

.mini-status-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.foot-label {
  color: var(--text-dim);
}

.foot-val {
  font-weight: 500;
}

/* BADGES */
.badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-success {
  background-color: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
}

.badge-warning {
  background-color: rgba(255, 179, 0, 0.15);
  color: var(--accent-yellow);
}

.badge-danger {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
}

.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-yellow); }
.text-danger { color: var(--accent-red); }
.text-info { color: #64b5f6; }

/* 2-COLUMN GRID */
.two-col-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-field {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.18s ease;
  font-family: var(--font-mono);
}

.input-field:focus {
  border-color: var(--border-focus);
}

.card-instruction {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-instruction strong {
  color: var(--text-main);
}

/* SYSTEM CARD */
.system-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.system-label {
  font-size: 12px;
  color: var(--text-dim);
}

.system-value {
  font-size: 13px;
  font-weight: 500;
}

.system-actions {
  margin-top: 16px;
}

/* RECENT ACTIONS */
.actions-preview-card .actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actions-empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 12px 0;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.action-target-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background-color: rgba(124, 77, 255, 0.2);
  color: #b388ff;
}

.action-target-badge.Roblox {
  background-color: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
}

.action-target-badge.PC {
  background-color: rgba(68, 138, 255, 0.2);
  color: #82b1ff;
}

.action-tool {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-main);
  flex: 1;
}

.action-time {
  font-size: 12px;
  color: var(--text-dim);
}

/* TERMINAL & LOGS */
.terminal {
  background-color: #0b0c12;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cfd3dc;
  height: 480px;
  overflow-y: auto;
  line-height: 1.6;
}

.log-line {
  margin-bottom: 3px;
  word-break: break-all;
}

.log-line.INIT { color: #80d8ff; }
.log-line.INFO { color: #b0bec5; }
.log-line.OK, .log-line.CONNECT { color: #00e676; }
.log-line.WARN { color: #ffd54f; }
.log-line.ERROR, .log-line.EMERGENCY { color: #ff5252; }
.log-line.MCP { color: #b388ff; }
.log-line.TOOL { color: #ffab40; }

.logs-toolbar, .actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.logs-indicator {
  font-size: 12px;
  color: var(--accent-green);
}

/* MORNING BRIEF PREVIEW */
.brief-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.brief-textarea {
  width: 100%;
  height: 400px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.about-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.about-label {
  font-size: 12px;
  color: var(--text-dim);
}

.about-val {
  font-size: 13px;
  font-weight: 500;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--accent-purple);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 18px var(--accent-purple-glow);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.22s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
