* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  background: #f5f6f8;
  color: #1a1a1a;
}

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

h1 { font-size: 18px; margin: 0; }
h2 { font-size: 16px; margin: 0; }

.logout-link, .refresh-link {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
}

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

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e5e5e5;
}

.card.centered {
  max-width: 340px;
  margin: 60px auto;
}

label {
  display: block;
  font-size: 13px;
  margin-top: 12px;
  margin-bottom: 4px;
  color: #444;
}

input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  font-size: 15px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  background: #e5e7eb;
  color: #1a1a1a;
  font-size: 13px;
}

button:disabled { opacity: 0.4; cursor: not-allowed; }

button.primary {
  background: #2563eb;
  color: white;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 16px;
}

.error {
  background: #fee2e2;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.hint { font-size: 13px; color: #888; }

.app-card {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

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

.app-name { font-weight: 700; font-size: 15px; }

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}
.status-online { background: #dcfce7; color: #16a34a; }
.status-stopped { background: #fee2e2; color: #dc2626; }
.status-other { background: #fef3c7; color: #b45309; }

.app-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.logs-link {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  margin-left: auto;
}

.log-box {
  background: #111827;
  color: #d1d5db;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

nav a {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  margin-left: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 6px 0;
}
.checkbox-label input { width: auto; }

.permissions-form {
  border-top: 1px solid #eee;
  margin-top: 10px;
  padding-top: 10px;
}

button.small {
  padding: 6px 10px;
  font-size: 12px;
}

button.danger {
  background: #fee2e2;
  color: #dc2626;
}

code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

#qr-placeholder {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.open-app-link {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  background: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.log-error { color: #fca5a5; }
