body {
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  padding: 0 16px 16px;
  box-sizing: border-box;
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
}

.wb-logo {
  display: flex;
  justify-content: center;
  margin: 20px 0 10px;
}

.wb-logo .logo-img {
  height: 40px;
}

.card {
  background-color: white;
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 400px;
  margin: 0 16px;
  margin-top: 16px;
  overflow: hidden;
}

.yandex-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #292933;
  color: #fff;
  font-family: 'YS Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  border-radius: 20px;
  padding: 10px 16px 10px 12px;
  text-decoration: none;
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  text-align: center;
}

/* Left-aligned icon inside the button */
.yandex-login-button .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  margin-right: 8px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.subtitle {
  margin-top: 1px;
  font-size: 14px;
  color: #888;
  text-align: center;
  font-weight: 350;
}

.controllers-section-title {
  font-size: 1.0rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #878a8d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.controllers-section-title::before {
  content: "🔗";
  font-size: 0.95rem;
}

.card-body {
  padding: 32px;
  text-align: left;
  background: transparent;
}

.user-section {
  background: white;
  padding: 12px 16px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.joined-row {
  font-size: .75rem;
  color: #6c757d;
  text-align: center;
}

.btn {
  display: block;
}

.btn-primary {
  font-weight: 500;
}

.controllers-list {
  text-align: left;
}

.controller-item {
  padding: 0;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  background: #f5f6f8;
  font-size: 1.1rem;
  border-radius: 10px;
  transition: box-shadow 0.2s ease;
  border: none;
  display: flex;
  align-items: stretch;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
}

.empty-text {
  font-size: 14px;
  color: #6c757d;
}

/* Controller avatar */
.wb-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border: 4px solid #dee2e6;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #495057;
  margin: 8px;
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
  gap: 1px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wb-avatar.online {
  border: 4px solid transparent;
  background: linear-gradient(145deg, #ffffff, #f8f9fa), linear-gradient(145deg, #28a745, #20c997);
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  color: #28a745;
}

.wb-avatar.offline {
  opacity: 0.6;
}

.wb-avatar .wb-text {
  font-size: 0.55rem;
  opacity: 0.8;
  font-weight: 600;
}

.wb-avatar .wb-number {
  font-size: 1rem;
  font-weight: 800;
}

.controller-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ctrl-content {
  flex: 1;
  padding: 10px 12px 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.status-line {
  margin-top: 2px;
  font-size: 0.75rem;
}

.status-text {
  font-weight: 600;
}

.status-text.online {
  color: #28a745;
}

.status-text.offline {
  color: #6c757d;
  cursor: help;
}

.time-text {
  color: #888;
  font-weight: 500;
  cursor: help;
}

.controller-item .ctrl-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 7px;
}

.btn-unlink {
  background: none;
  border: none;
  color: #cc0000;
  font-size: 16px;
  padding: 2px;
  margin-top: 2px;
  cursor: pointer;
  transition: color 0.2s ease;
  margin-left: 6px;
}

.btn-unlink:hover {
  color: #ff3333;
}

.stats-title {
  display: block;
  font-size: .64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .45px;
  color: #6c757d;
  margin-bottom: 4px;
  position: relative;
}

.stats-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c1c4c7;
  transform: translateY(-50%);
}

.stats-wrapper {
  margin: 18px 0;
  padding: 10px 12px 8px;
  background: #f9fafb;
  border: 1px solid #eef0f2;
  border-radius: 6px;
}

.controller-item .stats-wrapper {
  margin: 10px 0 6px;
  background: #fcfcfd;
  border-color: #f4f6f7;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  padding: 2px 0;
}

.stats-row .value {
  font-weight: 600;
  min-width: 30px;
  text-align: right;
}

.stats-row .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666;
}

.stats-row small {
  color: #888;
  margin-left: 6px;
}

.icon {
  width: 18px;
  display: inline-block;
  text-align: center;
}

/* .icon img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  border-radius: 50%;
} */

.stats-row[data-dir="in"] .icon {
  color: #0d6efd;
}

.stats-row[data-dir="out"] .icon {
  color: #28a745;
}

.stats-row[data-dir="err"] .icon {
  color: #dc3545;
}

.accordion-item {
  border: none;
  background: none;
  box-shadow: none;
}

.accordion-button {
  background: none;
  color: #aaa;
  font-weight: 400;
  padding: 0.3rem 0.5rem;
  font-size: 0.68rem;
  border: none;
  box-shadow: none;
  transition: all 0.2s ease;
}

/* .accordion-button:focus {
  box-shadow: none;
} */

.accordion-button:not(.collapsed) {
  background: none;
  color: #777;
  font-weight: 500;
  font-size: 0.7rem;
}


.accordion-button::after {
  filter: grayscale(100%);
  opacity: 0.4;
  scale: 0.8;
}

.accordion-collapse {
  border-top: 1px solid #dee2e6;
}

.q-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.68rem;
  border-radius: 50%;
  background: none;
  color: #999;
  font-weight: 600;
  margin-right: 8px;
  opacity: 0.5;
}

.accordion-body {
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  background: none;
  color: #666;
  border: none;
}

.accordion-body ol {
  padding-left: 1rem;
  margin: 0;
}

.accordion-body li {
  margin-bottom: 6px;
}


.show-statistics {
  display: block;
  align-items: center;
  font-size: 0.75rem;
  color: #92beff;
  text-decoration: none;
  margin-top: 6px;
  text-align: center;
}
.show-statistics::before {
  content: "ℹ️";
  font-size: 1.15rem;
  margin-right: 4px;
}

.footer-note {
  margin-top: 20px;
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  padding: 10px 20px 30px;
}

.footer-note a {
  color: #3cb464;
  text-decoration: none;
}

@media (max-width: 480px) {
  .card {
    margin-top: 10px;
  }

  .controller-item {
    font-size: 14px;
    padding: 6px 10px;
  }

  .btn-unlink {
    font-size: 16px;
  }
}

/* Sessions table styling */
.sessions-table {
  font-size: 0.75rem;
  margin-bottom: 0;
}

.sessions-table th {
  font-weight: 600;
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #dee2e6;
  padding: 8px 6px;
}

.sessions-table td {
  padding: 6px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f4;
}

.sessions-table tbody tr:hover {
  background-color: #f8f9fa;
}

.sessions-table .reason-cell {
  font-size: 0.7rem;
  color: #dc3545;
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-responsive {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}
