/* WAHA-style dark dashboard - multi session */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.dashboard-dark {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1d23;
  color: #e4e6eb;
  min-height: 100vh;
}

.dashboard-dark .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #24262d;
  border-bottom: 1px solid #3a3d45;
}

.dashboard-dark .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-dark .menu-btn {
  background: none;
  border: none;
  color: #b0b3b8;
  padding: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

.dashboard-dark .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e4e6eb;
}

.dashboard-dark .logo-icon {
  width: 28px;
  height: 28px;
  background: #00a884;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.dashboard-dark .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-dark .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #3a3d45;
  color: #b0b3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.dashboard-dark .icon-btn:hover {
  background: #4a4d55;
  color: #fff;
}

.dashboard-dark .main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Summary cards */
.dashboard-dark .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.dashboard-dark .card {
  background: #24262d;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #3a3d45;
  position: relative;
  overflow: hidden;
}

.dashboard-dark .card-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0.9;
}

.dashboard-dark .card-icon.sessions {
  background: rgba(0, 168, 132, 0.2);
  color: #00a884;
}

.dashboard-dark .card-icon.servers {
  background: rgba(88, 101, 242, 0.2);
  color: #5865f2;
}

.dashboard-dark .card-icon.version {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.dashboard-dark .card-title {
  font-size: 0.85rem;
  color: #b0b3b8;
  margin-bottom: 6px;
}

.dashboard-dark .card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e4e6eb;
  margin-bottom: 8px;
}

.dashboard-dark .card-status {
  font-size: 0.8rem;
  color: #b0b3b8;
}

.dashboard-dark .card-status .working {
  color: #00a884;
}

.dashboard-dark .card-status .stopped {
  color: #8a8d91;
}

.dashboard-dark .card-status .warn {
  color: #f59e0b;
}

/* Section */
.dashboard-dark .section {
  background: #24262d;
  border-radius: 12px;
  border: 1px solid #3a3d45;
  overflow: hidden;
  margin-bottom: 24px;
}

.dashboard-dark .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #3a3d45;
}

.dashboard-dark .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #e4e6eb;
}

.dashboard-dark .section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-dark .btn-start-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #00a884;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.dashboard-dark .btn-start-new:hover {
  background: #008f72;
}

.dashboard-dark .search-input {
  padding: 8px 14px 8px 36px;
  border-radius: 8px;
  border: 1px solid #3a3d45;
  background: #1a1d23;
  color: #e4e6eb;
  font-size: 0.9rem;
  width: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a8d91' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.dashboard-dark .search-input::placeholder {
  color: #8a8d91;
}

/* Table */
.dashboard-dark .table-wrap {
  overflow-x: auto;
}

.dashboard-dark table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-dark th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8a8d91;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #3a3d45;
}

.dashboard-dark th.sortable {
  cursor: pointer;
  user-select: none;
}

.dashboard-dark th.sortable:hover {
  color: #b0b3b8;
}

.dashboard-dark td {
  padding: 14px 20px;
  border-bottom: 1px solid #2d3036;
  font-size: 0.9rem;
  vertical-align: middle;
}

.dashboard-dark tr:last-child td {
  border-bottom: none;
}

.dashboard-dark tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-dark .name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-dark .name-cell .info-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 168, 132, 0.2);
  color: #00a884;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.dashboard-dark .name-cell .phone-mask {
  color: #8a8d91;
  font-size: 0.85rem;
}

.dashboard-dark .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dashboard-dark .status-pill.working {
  background: rgba(0, 168, 132, 0.2);
  color: #00a884;
}

.dashboard-dark .status-pill.loading {
  background: rgba(88, 101, 242, 0.2);
  color: #818cf8;
}

.dashboard-dark .status-pill.stopped {
  background: rgba(138, 141, 145, 0.2);
  color: #8a8d91;
}

.dashboard-dark .status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dashboard-dark .status-pill.loading .dot {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dashboard-dark .row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dashboard-dark .row-actions .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.dashboard-dark .row-actions .icon-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.dashboard-dark .row-actions .icon-btn.start:hover {
  background: rgba(0, 168, 132, 0.2);
  color: #00a884;
}

.dashboard-dark .row-actions .icon-btn.stop:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

/* Pagination */
.dashboard-dark .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid #3a3d45;
}

.dashboard-dark .pagination button {
  min-width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #b0b3b8;
  cursor: pointer;
  font-size: 0.85rem;
}

.dashboard-dark .pagination button:hover {
  background: #3a3d45;
  color: #fff;
}

.dashboard-dark .pagination button.active {
  background: #00a884;
  color: #fff;
}

.dashboard-dark .pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal */
.dashboard-dark .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.dashboard-dark .modal {
  background: #24262d;
  border-radius: 12px;
  border: 1px solid #3a3d45;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-dark .modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid #3a3d45;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-dark .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.dashboard-dark .modal-close {
  background: none;
  border: none;
  color: #8a8d91;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.dashboard-dark .modal-body {
  padding: 20px;
  overflow-y: auto;
}

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

.dashboard-dark .form-group label {
  display: block;
  font-size: 0.85rem;
  color: #b0b3b8;
  margin-bottom: 6px;
}

.dashboard-dark .form-group .form-hint {
  display: block;
  font-size: 0.75rem;
  color: #8a8d91;
  margin-top: 6px;
}

.dashboard-dark .form-group input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #3a3d45;
  background: #1a1d23;
  color: #e4e6eb;
  font-size: 0.95rem;
}

.dashboard-dark .form-group input.readonly-input {
  background: #2d3036;
  color: #8a8d91;
  cursor: default;
}

.dashboard-dark .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #3a3d45;
  background: #1a1d23;
  color: #e4e6eb;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
}

.dashboard-dark .row-actions .icon-btn.send:hover {
  background: rgba(0, 168, 132, 0.2);
  color: #00a884;
}

.dashboard-dark .qr-display {
  text-align: center;
  padding: 24px;
  background: #1a1d23;
  border-radius: 8px;
  margin-top: 16px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dashboard-dark .qr-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}

.dashboard-dark .qr-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #3a3d45;
  border-top-color: #00a884;
  border-radius: 50%;
  animation: qr-spin 0.9s linear infinite;
}

.dashboard-dark .qr-loading-text {
  color: #b0b3b8;
  font-size: 0.95rem;
}

.dashboard-dark .qr-display.has-qr .qr-loading-wrap {
  display: none;
}

.dashboard-dark .qr-display .qr-image-wrap {
  display: none;
  width: 100%;
}

.dashboard-dark .qr-display.has-qr .qr-image-wrap {
  display: block;
}

.dashboard-dark .qr-display.has-qr .qr-image-wrap img {
  max-width: 220px;
  height: auto;
}

@keyframes qr-spin {
  to { transform: rotate(360deg); }
}

.dashboard-dark .qr-display img {
  max-width: 220px;
  height: auto;
}

.dashboard-dark .qr-display .hint {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #00a884;
}

.dashboard-dark .modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #3a3d45;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-dark .btn-secondary {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #3a3d45;
  background: transparent;
  color: #e4e6eb;
  cursor: pointer;
  font-size: 0.9rem;
}

.dashboard-dark .btn-secondary:hover {
  background: #3a3d45;
}

.dashboard-dark .btn-primary {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #00a884;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.dashboard-dark .btn-primary:hover {
  background: #008f72;
}

.dashboard-dark .empty-state {
  padding: 48px 20px;
  text-align: center;
  color: #8a8d91;
}

.dashboard-dark .empty-state p {
  margin-bottom: 12px;
}

.dashboard-dark .filter-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #3a3d45;
  background: #1a1d23;
  color: #e4e6eb;
  font-size: 0.8rem;
  cursor: pointer;
}

.dashboard-dark .toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.dashboard-dark .toast.success { background: #00a884; color: #fff; }
.dashboard-dark .toast.error { background: #ef4444; color: #fff; }
.dashboard-dark .toast.info { background: #3a3d45; color: #e4e6eb; }
